0

I want to run a query between my two tables and returns the results to me the lines that are not present in my table 2

mu is too short
  • 426,620
  • 70
  • 833
  • 800
Mercer
  • 9,736
  • 30
  • 105
  • 170

3 Answers3

2
select * from table1 
         left join table2 
         on table1.id=table2.id 
         where table2.id is null
Shakti Singh
  • 84,385
  • 21
  • 134
  • 153
0

Look at this post.
I copied the code:

select * from A left join B on A.x=B.y where B.y is null;
Community
  • 1
  • 1
Marco
  • 56,740
  • 14
  • 129
  • 152
0

Should be something like this:

SELECT * FROM table2 WHERE table1_id NOT IN (SELECT id FROM table1) 
Richard Tuin
  • 4,484
  • 2
  • 19
  • 18