Orcale查询前10行数据SQL语句怎么写? 请高手帮忙

根据某列取值,取值最大的前10条记录
2024-10-27 23:05:27
推荐回答(4个)
回答1:

select * from table where rownum<=10;
oracle 分页的几种常见方法
简单概括有如下4种:

minus差分页 select * from table where rownum<=10 minus select * from table where rownum<=5

rownum伪列select * from (select rownum tid,t.* from table t where rownum<=10) where tid<=10 and tid>=5

notin相反select * from table where id not in(select id from table where rownum<=5) and rownum<=5

前题是id排序的select * from table where id>(select max(id) from table where rownum<=5) and rownum<=5

回答2:

排序后。 select top(10)

回答3:

select * from table1 where rownum<=10

回答4:

.......俺来回答吧,这么点问题 都木人回答对。

代码贴出来不就好了。

select * from table_Name where rownum<=10 order by column_Name desc

看不懂,自己自杀去吧。哇咔咔