一条查询语句
语名如下:
select top 300 * from kq_source where tt> = '1 ' and tt <= '100 '
and empid in (select id from zlemployee where Dept= 'zx ' and state <> '9 ')
执行速度在1分钟左右~如IN后面直接用值却很快。
请高手帮我优化!
[解决办法]
select top 300 * from kq_source ,
((select id from zlemployee where Dept= 'zx ' and state <> '9 ')) t
where tt> = '1 ' and tt <= '100 ' and kq_source.empid = t.id