您的位置:首页 > 数据库

对多表联合查询的SQl语句的改进,大幅提高查询性能

2006-07-13 14:56 676 查看
常用的多表联合查询的sql语句:
select table1.ID from table1 inner join table2 on table1.ID=table2.ID
where table2.col2='xxx'

改进后:
select a.ID from table1 a,
(select col1,ID from table2 where col2='xxx') b
where a.ID=b.ID
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: