4. Selecting ROWS to display: Step 21

Demo

Show distinct department numbers in the emp table.

If we want to show the distinct department numbers, i.e. to list the departments with employees, then:

SQL

SELECT DISTINCT deptno FROM emp;

Output

deptno
20
30
10

Progress

Proceed to Next step