Fight With Me!!!

导航

oracle从子表取出前几行数据:

取排序后的前几行,应该用:

select * from(select * from test order by stamp desc) where rownum<= 6  (表示排序后取前几行)

 

而不应该使用:

select * from test where rownum<= 6  order by stamp desc (表示取前几行后再排序)

posted on 2016-06-11 10:59  nickTimer  阅读(1172)  评论(0编辑  收藏  举报