BREAK
Example
Section titled “Example”BREAK ON DEPARTMENT_ID;SELECT * FROM EMPLOYEESORDER BY DEPARTMENT_ID;Output
Section titled “Output”DEPARTMENT_ID EMPLOYEE_ID FIRST_NAME LAST_NAME------------- ----------- ---------- ----------10 200 Jennifer Whalen20 201 Michael Hartstein 202 Pat Fowler30 114 Den Raphaely 115 Alexander Khoo 116 Shelli Baida 117 Sigal Tobias 118 Guy Himuro 119 Karen ColmenaresExplanation
Section titled “Explanation”BREAK command in Oracle SQL is used to suppress the duplicate values of a certain column in the output. It is usually used together with the ORDER BY clause. In the example provided, BREAK ON DEPARTMENT_ID suppresses subsequent display of the DEPARTMENT_ID when the value is the same as the DEPARTMENT_ID value of the previous row.