日期:2014-05-19  浏览次数:20485 次

一条查询语句
语名如下:
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