<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Decode360's Blog

    業(yè)精于勤而荒于嬉 QQ:150355677 MSN:decode360@hotmail.com

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 ::  :: 管理 ::
      397 隨筆 :: 33 文章 :: 29 評(píng)論 :: 0 Trackbacks
    關(guān)于Break On [SQLPlus]
    ?
    ??? 今天繼續(xù)來學(xué)習(xí)一下SQLPLUS中的Report函數(shù)。這個(gè)在工作中使用到的機(jī)會(huì)不多,但是做好之后把結(jié)果打印出來看著會(huì)很爽。
    ??? 參考文檔:《SQL*Plus User's Guide and Reference Release 10.2 B14357-01》
    ?
    ?
    Break ON
    ?
    ??? ?The BREAK command suppresses duplicate values by default in the column or expression you name. Thus, to suppress the duplicate values in a column specified in an ORDER BY clause, use the BREAK command in its simplest form:
    ?
    ??? BREAK ON break_column
    ?
    ??? Note: Whenever you specify a column or expression in a BREAK command, use an ORDER BY clause specifying the same column or
    expression. If you do not do this, breaks occur every time the column value changes.

    SQL> break on deptno
    SQL> select deptno,empno,sal from emp
    ? 2? where sal>1500
    ? 3? order by deptno;
    ?
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 10?????? 7782?????? 2450
    ???????????????? 7839?????? 5000
    ??????? 20?????? 7566?????? 2975
    ???????????????? 7788?????? 3000
    ???????????????? 7902?????? 3000
    ??????? 30?????? 7499?????? 1600
    ???????????????? 7698?????? 2850
    ?
    7 rows selected.
    ?
    ?
    Break ON ... Skip
    ?
    ??? You can insert blank lines or begin a new page each time the value changes in the break column. To insert n blank lines, use the BREAK command in the following form:
    ??? BREAK ON break_column SKIP n
    ?
    SQL> break on deptno skip 1
    SQL> /
    ?
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 10?????? 7782?????? 2450
    ???????????????? 7839?????? 5000
    ?
    ??????? 20?????? 7566?????? 2975
    ???????????????? 7788?????? 3000
    ???????????????? 7902?????? 3000
    ?
    ??????? 30?????? 7499?????? 1600
    ???????????????? 7698?????? 2850
    ?

    7 rows selected.
    ?
    ?
    Skip Every Row
    ?
    ??? You may wish to insert blank lines or a blank page after every row. To skip n lines after every row, use BREAK in the following form:
    ??? BREAK ON ROW SKIP n
    ??? To skip a page after every row, use
    ??? BREAK ON ROW SKIP PAGE
    ?
    SQL> break on row skip 1
    SQL> /
    ?
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 10?????? 7782?????? 2450
    ?
    ??????? 10?????? 7839?????? 5000
    ?
    ??????? 20?????? 7566?????? 2975
    ?
    ??????? 20?????? 7788?????? 3000
    ?
    ??????? 20?????? 7902?????? 3000
    ?
    ??????? 30?????? 7499?????? 1600
    ?
    ??????? 30?????? 7698?????? 2850
    ?

    7 rows selected.
    ?
    SQL> break on row skip page
    SQL> /
    ?
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 10?????? 7782?????? 2450
    ?
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 10?????? 7839?????? 5000
    ?
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 20?????? 7566?????? 2975
    ?
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 20?????? 7788?????? 3000
    ?
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 20?????? 7902?????? 3000
    ?
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 30?????? 7499?????? 1600
    ?
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 30?????? 7698?????? 2850
    ?
    7 rows selected.
    ?
    ?
    Other?Example
    ?
    ??? To show that SKIP PAGE has taken effect, create a TTITLE with a page number:
    ?
    SQL> ttitle col 35 format 9 'Page:' SQL.PNO
    SQL> /
    ?
    ????????????????????????????????? Page: 1
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 10?????? 7782?????? 2450
    ?
    ???????????????? 7839?????? 5000
    ?

    ????????????????????????????????? Page: 2
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 20?????? 7566?????? 2975
    ?
    ???????????????? 7788?????? 3000
    ?
    ???????????????? 7902?????? 3000
    ?

    ????????????????????????????????? Page: 3
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 30?????? 7499?????? 1600
    ?
    ???????????????? 7698?????? 2850
    ?

    7 rows selected.
    ?
    ?
    Listing and Removing Break

    ??? You can list your current break definition by entering the BREAK command with no clauses:
    ???
    BREAK
    ??? You can remove the current break definition by entering the CLEAR command withthe BREAKS clause:
    ??? CLEAR BREAKS
    ??? You may wish to place the command CLEAR BREAKS at the beginning of every scriptto ensure that previously entered BREAK commands will not affect queries you run ina given file.
    ?
    ?
    Break and Compute
    ?
    ??? If you organize the rows of a report into subsets with the BREAK command, you can perform various computations on the rows in each subset. You do this with the functions of the SQL*Plus COMPUTE command. Use the BREAK and COMPUTE commands together in the following forms:
    ??? BREAK ON break_column
    ??? COMPUTE function LABEL label_name OF column column column
    ??? ... ON break_column
    ?
    SQL> compute sum of sal on deptno
    SQL> /
    ?
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 10?????? 7782?????? 2450
    ???????????????? 7839?????? 5000
    ********** ********** ----------
    sum???????????????????????? 7450
    ?
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 20?????? 7566?????? 2975
    ???????????????? 7788?????? 3000
    ???????????????? 7902?????? 3000
    ********** ********** ----------
    sum???????????????????????? 8975
    ?
    ??? DEPTNO????? EMPNO??????? SAL
    ---------- ---------- ----------
    ??????? 30?????? 7499?????? 1600
    ???????????????? 7698?????? 2850
    ********** ********** ----------
    sum???????????????????????? 4450
    ?
    7 rows selected.
    ?
    ?
    Over.
    ?
    ?
    posted on 2009-04-03 23:05 decode360 閱讀(570) 評(píng)論(0)  編輯  收藏 所屬分類: 05.SQL
    主站蜘蛛池模板: 亚洲精品一级无码鲁丝片 | 亚洲爆乳成av人在线视菜奈实| 在线观看亚洲AV每日更新无码| 欧美色欧美亚洲另类二区| 阿v视频免费在线观看| 国产午夜精品理论片免费观看| 免费视频精品一区二区三区 | 精品国产日韩亚洲一区| 日本亚洲成高清一区二区三区 | 亚洲av日韩av永久无码电影| 在线播放免费人成视频网站| 嫩草影院在线播放www免费观看| 波多野结衣在线免费观看| 又色又污又黄无遮挡的免费视| 亚洲成AV人片一区二区| 亚洲第一男人天堂| 日韩在线视频免费| 久久久久免费看成人影片| 午夜视频在线观看免费完整版| 国产亚洲精品看片在线观看| 亚洲美女视频一区二区三区| MM1313亚洲国产精品| 亚洲免费人成在线视频观看| 在线天堂免费观看.WWW| 久久久久亚洲AV无码专区网站 | 亚洲第一AV网站| 亚洲熟女乱色一区二区三区| CAOPORN国产精品免费视频| 91免费资源网站入口| AV在线亚洲男人的天堂| 亚洲专区一路线二| 怡红院免费的全部视频| 嫩草影院在线免费观看| 亚洲va在线va天堂va888www| 久久亚洲精品无码gv| 99久热只有精品视频免费观看17| 国产午夜影视大全免费观看| 精品亚洲aⅴ在线观看| 免费又黄又爽又猛大片午夜| 国产免费女女脚奴视频网| 曰韩亚洲av人人夜夜澡人人爽|