在 oracle 中使用 SQL 查询时, 可以用“ rownumn ”来取得 top n 的记录,但当使用 order by 关键字进行排序时就有问题了(可以试试)。 如下 sql script: 【 select [column] from[table_name] where rownum= 5 order by[column] desc 】 当使用 order by
在 oracle 中使用 SQL 查询时, 可以用“ rownum ”来取得 top n 的记录,但当使用 order by 关键字进行排序时就有问题了(可以试试)。
如下 sql script:
【 select [column] from [table_name] where rownum 5
order by [column] desc 】
当使用 order by 时应写成:
【 select [column] from
(select [column] from [table_name]
order by [ column] desc ) where rownum 1 】
查看更多关于oracle的Topn时排序问题的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did96811