Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MS Access Sql -  Using Join to list items that don't match

Posted on 2013-11-27
3
Medium Priority
?
391 Views
Last Modified: 2013-11-28
If I have 2 tables:

CREATE TABLE Items20123( Id VarChar(15), UserName VarChar(50))
CREATE TABLE Items2011( Id VarChar(15), UserName VarChar(50))

How do I use the join command to list all of the Id's from the Items2012 table that don't exist in the Items2011 table?

I tried

Select * from Items2012 Inner Join Items2011 on Items2012.item <> Items2011.item

But got an out of memory exception.

There are about 35,000 in each table.
0
Comment
Question by:ou81aswell
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1000 total points
ID: 39682672
use a Left Join

Select * from
Items2012 LEFT Join Items2011 on Items2012.[ID] = Items2011.[ID]
where  Items2011.[ID] is null
0
 
LVL 39

Assisted Solution

by:Pratima Pharande
Pratima Pharande earned 1000 total points
ID: 39682771
for the requirement  list all of the Id's from the Items2012 table that don't exist in the Items2011
try this

select * from Items2012
where Id not in ( select Id from Items2011)
0
 

Author Closing Comment

by:ou81aswell
ID: 39683332
Thanks guys. That's just what I needed. I used the first suggestion but appreciate the simplicity of the second.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question