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.
| Author |
Topic |
|
michaelp2010
Starting Member
2 Posts |
Posted - 2010-08-06 : 06:36:53
|
| Hi folksI need some advice on a join statement. Here's my scenario.I have two tables, one with property details and one with repair details.The two have a common field of property reference, what I need to do is return all properties which don't have any entries in the repair table. Any guidance would be much appreciated.ThanksMichael |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-08-06 : 06:42:52
|
[code]select *from property pwhere not exists ( select * from repair r where r.reference = p.reference )[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
michaelp2010
Starting Member
2 Posts |
Posted - 2010-08-06 : 06:58:57
|
Hi khtan, thanks for the prompt solution..quote: Originally posted by khtan
select *from property pwhere not exists ( select * from repair r where r.reference = p.reference ) KH[spoiler]Time is always against us[/spoiler]
|
 |
|
|
|
|
|