oracle提取表一个 表3-5行,用两种sql语句实现,其中一种用minus
答案:1 悬赏:0 手机版
解决时间 2021-03-25 12:08
- 提问者网友:练爱
- 2021-03-25 01:41
oracle提取表一个 表3-5行,用两种sql语句实现,其中一种用minus
最佳答案
- 五星知识达人网友:未来江山和你
- 2021-03-25 02:36
满意请采纳
方法一:
select * from tabletest1 a
where rownum <= 5
minus
select * from tabletest1 b
where rownum <= 2
方法二:
select * from
(
select a.*, rownum as rn from tabletest1 a
where rownum <= 5
) b
where b.rn > 2;
方法三:
select * from
(
select a.*, rownum as rn from tabletest1 a
) b
where b.rn between 3 and 5;
方法一:
select * from tabletest1 a
where rownum <= 5
minus
select * from tabletest1 b
where rownum <= 2
方法二:
select * from
(
select a.*, rownum as rn from tabletest1 a
where rownum <= 5
) b
where b.rn > 2;
方法三:
select * from
(
select a.*, rownum as rn from tabletest1 a
) b
where b.rn between 3 and 5;
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯