Bo's Oracle Station

查看: 1304|回复: 0

with ties语法

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2020-9-6 21:48:30 | 显示全部楼层 |阅读模式
  1. create table t071fi03_with_ties  ( a number , b varchar2(20));

  2. insert into t071fi03_with_ties values (1,'B');

  3. insert into t071fi03_with_ties values (1,'B');

  4. insert into t071fi03_with_ties values (1,'B');

  5. insert into t071fi03_with_ties values (2,'B');

  6. insert into t071fi03_with_ties values (2,'B');

  7. insert into t071fi03_with_ties values (2,'B');

  8. insert into t071fi03_with_ties values (2,'B');

  9. insert into t071fi03_with_ties values (2,'B');

  10. insert into t071fi03_with_ties values (2,'B');

  11. insert into t071fi03_with_ties values (2,'B');

  12. insert into t071fi03_with_ties values (2,'B');

  13. insert into t071fi03_with_ties values (2,'B');

  14. insert into t071fi03_with_ties values (2,'B');

  15. insert into t071fi03_with_ties values (2,'B');

  16. commit;

  17. select  * from t071fi03_with_ties;

  18. begin
  19.   for i in 3..100
  20.   loop
  21.     insert into t071fi03_with_ties values    (i, 'X');
  22.   end loop;
  23.   commit;
  24. end;
  25. /

  26. select  * from t071fi03_with_ties
  27.   order by a
  28.   offset 2 rows
  29.   fetch next 5 rows with ties;
  30.   
  31. select  * from t071fi03_with_ties
  32.   order by a
  33.   offset 2 rows
  34.   fetch next 5 rows only;
  35.   
  36. select  * from t071fi03_with_ties
  37.   order by a
  38.   offset 2 rows
  39.   fetch next 5 percent rows with ties;

  40. select  * from t071fi03_with_ties
  41.   order by a
  42.   offset 2 rows
  43.   fetch next 5 percent rows only;
  44.   
  45.   select  * from t071fi03_with_ties
  46.   order by a
  47.   offset 2 rows
  48.   fetch next 10 percent rows with ties;

  49. select  * from t071fi03_with_ties
  50.   order by a
  51.   offset 2 rows
  52.   fetch next 10 percent rows only;
  53.   
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-25 06:26 , Processed in 0.040303 second(s), 25 queries .

快速回复 返回顶部 返回列表