Reputation: 2349
I have two tables:
employee(e_id,e_name,d_id),department(d_id,d_name)
my query is:
select d.d_name from department d where d.d_id not in (
select distinct e.d_id from employee e);
is there any alternative way to do this?.
Upvotes: 0
Views: 480
Reputation: 1020
Try this.
select department.* from department
left join employee
on employee.d_id = department.d_id
where employee.d_id is null
Upvotes: 1