Datasheet
Writing Simple Queries
27
DEPARTMENT_ID
-------------
100
30
20
70
90
110
50
40
80
10
60
12 rows selected.
To demonstrate that uniqueness is enforced across the row, let’s do one more query using
the
SELECT DISTINCT clause. Notice DEPARTMENT_ID repeating for each JOB_ID value in the
following example:
SELECT DISTINCT department_id, job_id
FROM employees;
DEPARTMENT_ID JOB_ID
------------- ----------
110 AC_ACCOUNT
90 AD_VP
50 ST_CLERK
80 SA_REP
110 AC_MGR
… … …
10 AD_ASST
20 MK_REP
40 HR_REP
30 PU_MAN
20 rows selected.
95127c01.indd 27 2/18/09 6:37:09 AM