当前位置: 代码迷 >> Oracle开发 >> 先排序然后取前10条记录该怎么做?顶者有分
  详细解决方案

先排序然后取前10条记录该怎么做?顶者有分

热度:44   发布时间:2016-04-24 07:39:23.0
先排序然后取前10条记录该如何做?顶者有分!
我直接这样写的:
select   field1   from   mytable   where   rownum <=10   order   by   field2   desc
但是这样得到的前10条记录并不是所有记录排序的结果
要得到我想要的结果,应该怎么写呢?

------解决方案--------------------
select * from entainment t where rownum <10 and t.c__channelid=190 order by newsid desc;
  相关解决方案