Skip to Main Content

SQL & PL/SQL

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!

Oracle query to display just one employee for every department

2982301Jul 1 2015 — edited Jul 1 2015

hello

I am looking for an efficient query which will display a report having following columns

Dept | Employee id

(Field to join is DEPT_ID)

Where Departments are stored in DEPT table and list of employees is stored in EMP table. What I want is a join between 2 table but display just one employee (any random) for each department.

At the moment if I fire inner join it displays all employees from EMP table.

Abhijeet

This post has been answered by AlbertoFaenza on Jul 1 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 29 2015
Added on Jul 1 2015
8 comments
2,852 views