tommo74 Posted December 21, 2007 Share Posted December 21, 2007 I'm stuck on a query for a while now, maybe somebody could help. If I have two tables, say Table1 and Table2, and they both have a column called Code. I want to select everything from Table1 where there is data in the Code column in Table1 that is'nt in the Code column in Table2. For example if all the data is the same in both columns except Table 1 has one entry in the Code column thats not in the Table2 Code column, how would I select that one row from Table1 ? Thanks Quote Link to comment Share on other sites More sharing options...
beebum Posted December 21, 2007 Share Posted December 21, 2007 SELECT Table1.Code FROM Table1 LEFT JOIN Table2 ON Table1.Code=Table2.Code WHERE Table2.Code IS NULL; Quote Link to comment Share on other sites More sharing options...
tommo74 Posted December 21, 2007 Author Share Posted December 21, 2007 Thanks ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.