ITPub博客

首页 > Linux操作系统 > Linux操作系统 > plsql查询中补入空行--做报表分页挺有用(转)

plsql查询中补入空行--做报表分页挺有用(转)

原创 Linux操作系统 作者:kawontony 时间:2013-02-22 09:45:49 0 删除 编辑
/*这行把查询的结果中和10的倍数差查出来*/
with cnt as (select 10-mod(count(*),10) from scott.emp)
select scott.emp.empno,scott.emp.ename
from scott.emp
union all
select null,null
from all_objects where rownum<=(select * from cnt);
/*引用with子句中需要补的空行数目 */
结果:
1 7369 SMITH
2 7499 ALLEN
3 7521 WARD
4 7566 JONES
5 7654 MARTIN
6 7698 BLAKE
7 7782 CLARK
8 7788 SCOTT
9 7839 KING
10 7844 TURNER
11 7876 ADAMS
12 7900 JAMES
13 7902 FORD
14 7934 MILLER
15 1000 IVON
16 2313 DSASA
17 2 233
18
19
20

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24627116/viewspace-754544/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-11-17

  • 博文量
    183
  • 访问量
    433677