SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
B-9
Examples—BREAK ON
Examples—BREAK ON
This example groups detail lines by job codes within groups of departments. When
finished, enter CANCEL at the select-in progress prompt (S>):
>> SET LIST_COUNT 0;
>> SELECT LAST_NAME, FIRST_NAME, JOBCODE, DEPTNUM
+> FROM PERSNL.EMPLOYEE
+> WHERE SALARY > 20000
+> ORDER BY DEPTNUM, JOBCODE;
S> BREAK ON DEPTNUM, JOBCODE;
S> LIST NEXT 8;
LAST_NAME FIRST_NAME JOBCODE DEPTNUM
-------------------- --------------- ------- -------
HOWARD JERRY 100 1000
CLARK LARRY 500
BARTON RICHARD
KELLY JULIA
WHITE ROBERT 100 1500
SCHNEIDER JIMMY 600
MITCHELL JONATHAN
RUDLOFF THOMAS 100 2000
S> CANCEL;
>>
This example groups detail lines by monthly salary and (within salary groups) by
job code and department number. When finished, enter CANCEL at the select-in
progress prompt (S>):
>> SET LIST_COUNT 0;
>> SELECT DEPTNUM, JOBCODE, SALARY/12
+> FROM PERSNL.EMPLOYEE
+> WHERE SALARY > 20000
+> ORDER BY 3, 2, 1;
S> BREAK ON COL 3, JOBCODE, DEPTNUM;
S> LIST NEXT 5;
DEPTNUM JOBCODE (EXPR)
------- ------- --------------------
3200 300 1833.333333333333
2000 200 2000.000000000000
4000 900 2000.075000000000
3200 900 2083.333333333333
1000 500 2083.395833333333
S> CANCEL;
>>