Inner Join needed?

bde7503

New Member
Joined
Dec 12, 2013
Messages
37
I am trying to return all records where the sid field doesn't match - this is just a test and there is just one record between the 2 tables where the sid doesn't match but i get no results returned.
I have to use an inner join to get the records returned for both tables correct?
Not sure why it wont return the 2 records so i can see the difference between the sids.
Any help is appreciated!

SELECT table1.fn,table1.sid,table1.loc,table2.fn,table2.sid,table2.loc
FROM table1 inner JOIN table2
ON table1.sid=table2.sid
where table2.sid is null
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
thanks, that works - is there any way to get it to return all the values? I know a left join will return all the records from table1 and of course it leaves the non matching from table 2 blank - I'd like to see them all, or does that simply require 2 separate queries?
 
Upvote 0
Run a left join query, then run a right join query. And finally, run a union query joining the first two queries.
 
Upvote 0

Forum statistics

Threads
1,214,962
Messages
6,122,482
Members
449,088
Latest member
Melvetica

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top