orcal数据库中怎么查询5-10行数据

orcal数据库中怎么查询5-10行数据,第1张

简单

(子查询前五条数据

然后去掉前)

再Top

5

不就是

5

-

10条的记录了

orcal我不会

sql的是这样写你

应该差不多吧!

select

Top

5

*

from

Table

where

id

not

in(select

Top

5

id

from

Table)

这个是oracle的写法,

如果查询的表中没有重复记录:

select a.* from 表 a where rownum<=(select max(rownum) from 表)-4

minus

select a.* from 表 a where rownum<=(select max(rownum) from 表)-10

如果查询的表中有重复记录:

select a.表字段 from

(select a.*,rownum from 表 a where rownum<=(select max(rownum) from 表)-4

minus

select a.*,rownum from 表 a where rownum<=(select max(rownum) from 表)-10) a


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/6831879.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-28
下一篇 2023-03-28

发表评论

登录后才能评论

评论列表(0条)

保存