Last post Jul 28, 2016 05:40 AM by Nan Yu
Jul 28, 2016 05:31 AM|demoninside9|LINK
Last week I was interviewed. The interviewer asked me a question regarding SQL.
The question is below, you can easily understand by the image. here I have to tables, I need to find records which is uncommon in second table i.e. I need to find out the records which are colored by black color. See the image below.
Jul 28, 2016 05:40 AM|Nan Yu|LINK
Hi Gaurav Kumar,
You could use left join , suppose table 1 has id ,name , table B has id , name , you want to find all records from table2 also not exist in table 1 ,query below is for your reference :
FROM table2 t2
LEFT JOIN table1 t1 ON t1.name = t2.name
WHERE t1.name IS NULL
WHERE name NOT IN
You could refer to below article for detail explaination :