Enregistrement présent dans table1 mais pas dans table2


/ Published in: SQL
Save to your folder(s)

I Have two tables table1, table2

table 1 contains rows not in table 2 how do i get a list or rows not in table 2

table 1

name desc
1 a
2 b
3 c

table 2

table1_name desc
1 z
3 x

I would like to select just row 2 from table 1.


Copy this code and paste it in your HTML
  1. SELECT table1.* FROM table1 LEFT JOIN table2 ON table1.name=table2.table1_name WHERE table2.table1_name IS NULL;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.