Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 select statement

Author  Topic 

cjcclee
Starting Member

33 Posts

Posted - 2008-07-24 : 15:37:14
I have two table A, B, one employee can have more than one depts in table A.

compare table A and B, How can I get all the rows that do not have record in table B.

for example as following, I want to get result
dept SS Hours
113 2222222 40
111 33333333 30
123 33333333 40

A:
dept SS Hours
111 22222222 10
113 22222222 40
111 33333333 30
123 33333333 40

B:

Dept SS
111 22222222


Thanks!

jdaman
Constraint Violating Yak Guru

354 Posts

Posted - 2008-07-24 : 15:53:33
homework?
Go to Top of Page

cjcclee
Starting Member

33 Posts

Posted - 2008-07-24 : 16:55:44
OK. I figure out.
right outer join, then select those row is null.

Thanks for reading my message!
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-24 : 16:59:57
quote:
Originally posted by cjcclee

OK. I figure out.
right outer join, then select those row is null.

Thanks for reading my message!



Left-outer join
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-25 : 01:04:58
or NOT IN
Go to Top of Page
   

- Advertisement -