Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to make query in ms access


what I want to do is

2 tables

1 tables secures 359 rec

2 tables secures 322 rec


I want to make query to get only those records which is not exist in table 2 ( 359 )
and do exist in table 1 ( 322 )

result should be 37 because 322 records are same records which exist in both tables
Posted

Try an INNER JOIN: It returns all rows when there is at least one match in BOTH tables:

SQL
SELECT a.* FROM Table1 a
INNER JOIN Table2 b
ON a.ID = b.ID


https://support.office.com/client/INNER-JOIN-Operation-b9e73ab6-884a-403e-9f22-cb502feae36a[^]
 
Share this answer
 
as you need the record not in table a use the below query

SQL
SELECT a.* FROM Table1 a
left JOIN Table2 b
ON a.ID = b.ID where b.id is null 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900