469,322 Members | 1,638 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,322 developers. It's quick & easy.

how can i go about executing these querries using joins?

Write a query to list:
all departments that don’t have employees,
all employees who don’t belong to any department.
Apr 21 '07 #1
1 992
temat
5
[all departments that donít have employees]
[PHP]Select * From dbo.Departaments
Where depID NOT IN (SELECT depID FROM dbo.Employees)
GO[/PHP]

[ all employees who donít belong to any department]
[PHP]Select * From dbo.Employees
Where depID NOT IN (SELECT depID FROM dbo.Departaments )
GO[/PHP]
Apr 21 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Prem | last post: by
4 posts views Thread by michaelnewport | last post: by
36 posts views Thread by TC | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.