W
wsn
Unregistered / Unconfirmed
GUEST, unregistred user!
这是一段sql语句,在sqlserver里可以执行,但是移植到oracle的是时候top N 问题我总也处理不好
刚刚接触oracle,还望大虾们指点
========================================================
select top 20 AnnounceID,parentID,boardID,UserName,child,Topic,DateAndTime,hits,RootID,locktopic,istop,isbest,isvote,LastPost
from bbs1
where boardID=3 and parentID=0 and istop=0 and times < all
(select top 20 times
from bbs1
where boardID=3 and istop=0 and parentID=0 order by times desc)
and not locktopic=2 ORDER BY istop desc,times desc,announceid desc
刚刚接触oracle,还望大虾们指点
========================================================
select top 20 AnnounceID,parentID,boardID,UserName,child,Topic,DateAndTime,hits,RootID,locktopic,istop,isbest,isvote,LastPost
from bbs1
where boardID=3 and parentID=0 and istop=0 and times < all
(select top 20 times
from bbs1
where boardID=3 and istop=0 and parentID=0 order by times desc)
and not locktopic=2 ORDER BY istop desc,times desc,announceid desc