作者jimshih (传说中的果汁学长)
看板Database
标题Re: [SQL ]请问子查询的效率
时间Wed Oct 17 16:35:24 2012
照推文的建议
如果改成
insert into oocd_breast_cancer
select oo.* from oo2002 oo, TEST
where TEST.date between '20020101' and '20021231' and TEST.id =oo2002.id
这样会不会比较快呢?
还请原po试看看罗~
※ 引述《s9234140 (麻淑菸酒生)》之铭言:
: 请问若我想新增多笔资料 子查询为有JOIN的动作
: 但是动作过久 请问要怎麽血才能优化此查询 感谢
: 语法如下
: insert into oocd_breast_cancer select * from oo2002 where id in
: ( select TEST.id from TEST, oo2002
: where TEST.date
: between 20020101 and 20021231 and TEST.id =oo2002.id)
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 60.251.147.41