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
 General SQL Server Forums
 New to SQL Server Programming
 Returning only non matching left Join records

Author  Topic 

infinityCounter
Starting Member

1 Post

Posted - 2015-03-03 : 20:49:53
Good day all.

I would very much appreciate any help on this. I am trying to figure out how to return only non matching left join records. Currently I am doing a traffic management database to help me learn sql.

I am checking for all parishes with no associated drivers. Currently I only have 2 of such.

The regular left join


select parish.name, driver.fname from parish left join driver on driver.parish=parish.name


returns the all the names of the parishes and the first name of the associated drive, followed by the matches, however the two parishes with no matches have null for the first name. Therefore if I could figure out how to check for this I would be fine but I am not sure how.

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-03-04 : 02:44:10
Add

Where driver.parish is null
Go to Top of Page
   

- Advertisement -