Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Display Job ID and Department ID using set operators

596980Sep 30 2007 — edited Oct 1 2007
I am trying to produce a list with the following output from table employees. This query will produce a list of jobs for departments 20, 60, and 25 in that order.
JOB_ID DEPARTMENT_ID
---------- -----------------------------
ASST 20
CLERK 60
MAN 60
MAN_B 25

So far I have the query to give the output but I can't figure out the order by part...please help.

SELECT job_id, department_id FROM employees
INTERSECT
SELECT job_id, department_id FROM employees WHERE department_id IN (20,60,25)
ORDER BY ???
;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 29 2007
Added on Sep 30 2007
2 comments
1,029 views