Oracle SQL - SQL Plus BREAK

Introduction

"break" the report on some column to produce easy-to-read output.

Demo

SELECT empno, ename, curr_salary, region 
FROM employee --  w  ww .  ja v a 2  s  . c om
ORDER BY region;

BREAK ON region 

SELECT empno, ename, curr_salary, region 
FROM employee 
ORDER BY region;

If a blank line is desired between the regions, we can enhance the BREAK command with a skip like this:

Demo

BREAK ON region skip1 

SELECT empno, ename, curr_salary, region 
FROM employee -- w ww  .  j av a2s. c om
ORDER BY region;

The query contains an ORDER BY clause that mirrors the BREAK command.

If the ORDER BY is not there, then the result will indeed break on REGION, but the result will contain random (i.e., unordered) breaks:

Demo

SELECT empno, ename, curr_salary, region 
FROM employee -- from  w  ww  .  j a  v  a2s.c o m
-- ORDER BY region

There can be only one BREAK command in a script or in effect at any one time.

If there is a second BREAK command in a script or session, the second one will supersede the first.