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

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

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

而不应该使用:

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

原文地址:https://www.cnblogs.com/toSeeMyDream/p/5574898.html