plsql查询中补入空行--做报表分页挺有用
生活随笔
收集整理的這篇文章主要介紹了
plsql查询中补入空行--做报表分页挺有用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
/*這行把查詢的結果中和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???
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???
轉載于:https://www.cnblogs.com/liuweicong39/archive/2012/06/01/2530658.html
總結
以上是生活随笔為你收集整理的plsql查询中补入空行--做报表分页挺有用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Excel 2007界面Ribbon功能
- 下一篇: Redhat安装tftp的方法