N
nciwp
Unregistered / Unconfirmed
GUEST, unregistred user!
第一种:<br>select * from HT_SUSPINFO a,<br>(<br>SELECT XLH FROM <br>(<br>SELECT ROWNUM RN ,A.XLH<br>FROM <br>(<br>select xlh from (<br>(select XLH,bksj from HT_SUSPINFO t <br> where bksj>(sysdate -10 <br> and HPHM like '浙%'<br> order by bksj desc) A <br>)<br>WHERE RN >= 0 and RN<=500<br>) b <br>where a.XLH =b.xlh <br><br>第二种:<br>select * from HT_SUSPINFO a,<br>(<br>SELECT XLH FROM <br>(<br>SELECT ROWNUM RN ,c.XLH<br>FROM (select xlh,hphm from(select XLH,hphm from HT_SUSPINFO t <br> where bksj>(sysdate -10 <br> order by bksj desc) A) c<br> where c.hphm like '浙%'<br> <br>WHERE RN >= 0 and RN<=500<br>) b <br>where a.XLH =b.xlh <br><br>第一种两个条件 第二种先过虑 在查询条件二<br><br>数据库oracle9 数据:170w++ ,我测试情况 第二种比第一种快很多,第一种查询很久没有结果,受不了就停下它了,第二种 大概0.04s左右,以前一直认为第一种快,请高手解答下!谢谢