亦梦亦真 发表于 2013-1-29 16:19:58

MYSQL子查询的优化

找cid 为1 2 3 中相同的ROWKEY
或是CID 为1 2 3 4 5 这样的多个的,可以写为
select rowkey from conditionresult_tab where cid=1 and rowkey in
(select rowkey from conditionresult_tab where cid=2 and rowkey in
(select rowkey from conditionresult_tab where cid=3))
,就是一个子查询,查询交集的,这样的SQL语句有什么优化方法呢?
现在这样的查询速度特别慢
页: [1]
查看完整版本: MYSQL子查询的优化