MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 27th, 2004, 07:35 AM
samymelbourne samymelbourne is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 14 samymelbourne User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 3 sec
Reputation Power: 0
help for opposite of sql inner join in access

Hi All,

I have a problem trying to create a query that will obtain those records (from two tables) which are not in each others table

IE)
T1--------------- T2---------------- QUERY RESULT
ID| Description--- ID| Description --- ID | Description
1 | yellow -------- 0 | white --------- 0 | white
2 | red ----------- 1 | yellow -------- 5 |blue
5 | blue ---------- 2 | red

Any help is appreciated in advance..
I have tried updates but it doesn't work..
I am sure there's has to be an easy way.. thank you!

Reply With Quote
  #2  
Old October 27th, 2004, 07:54 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,644 r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 6 Days 11 h 50 m
Reputation Power: 980
Code:
select T1.ID
     , T1.Description
  from T1
left outer
  join T2
    on T1.Description
     = T2.Description
 where T2.Description is null
union all
select T2.ID
     , T2.Description
  from T2
left outer
  join T1
    on T2.Description
     = T1.Description
 where T1.Description is null   
__________________
r937.com | rudy.ca

Reply With Quote
  #3  
Old October 27th, 2004, 08:04 AM
samymelbourne samymelbourne is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 14 samymelbourne User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 3 sec
Reputation Power: 0
THANK YOU!!! spent most of yesterday's afternoon trying to break this..


Quote:
Originally Posted by r937
Code:
select T1.ID
     , T1.Description
  from T1
left outer
  join T2
    on T1.Description
     = T2.Description
 where T2.Description is null
union all
select T2.ID
     , T2.Description
  from T2
left outer
  join T1
    on T2.Description
     = T1.Description
 where T1.Description is null   

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > help for opposite of sql inner join in access


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway