
April 27th, 2012, 06:43 AM
|
|
Contributing User
|
|
Join Date: Nov 2005
Posts: 53
Time spent in forums: 14 h 14 m 50 sec
Reputation Power: 8
|
|
|
Left Join / Join SQL Help need
Left Join / Join SQL Help need listing records that are not present
Using SQL Express 5 I’m trying to list entry’s from one table that aren’t listed in another table. Using the example below, Property 1 has a row for all imorder’s but property 2 does not have a row containing imorder = 3 and property 3 does not have a row containing imorder = 2. I want to list these two rows in my query.
I have tried various joins, left and right joins and not exists but I don’t seem to be able to make it work despite it seeming like a very basic thing to do.
Any help gratefully received!
Table: property
adId adpropname
1 property1
2 property2
2 property3
table: propertyimages
imId adid imorder
1 1 1
2 1 2
3 1 3
4 2 1
5 2 2
6 3 1
7 3 3
Output I want:
adpropname imorder
property2 3
property3 2
|