作者wenjieh (wenjie)
看板Database
标题Re: [SQL ]请问子查询的效率
时间Wed Oct 17 20:00:18 2012
※ 引述《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)
如果有 index ,
尽量使用 index 会比较快,
另外 exist 也会比 in 快
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.34.85.231