Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
I have two tables...let's say tableA and tableB when I dumped the data from tableA to tableB some record's are missing...
How to see the missings record's...
Can anyone help me with this by a SQL query...

What I have tried:

I tried JOINS like left join but I didn't get it
Posted
Updated 11-Oct-18 1:24am
v4
Comments
OriginalGriff 11-Oct-18 4:51am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
So perhaps some sample data input, the query you used, and the expected and actual; results would help?
Use the "Improve question" widget to edit your question and provide better information.
Mohibur Rashid 11-Oct-18 5:19am    
Is there any unique Id?
#realJSOP 11-Oct-18 7:08am    
If they're missing, they cannot be found. This is SQL zen.

1 solution

To find the records in table A which are not in table B:
SQL
SELECT
    ... Columns ...
FROM
    TableA

EXCEPT

SELECT
    ... Columns ...
FROM
    TableB

You'll need to select the same columns from both tables.
EXCEPT and INTERSECT (Transact-SQL) | Microsoft Docs[^]
 
Share this answer
 
Comments
Maciej Los 14-Oct-18 16:55pm    
5ed!

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