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
  • 413,090
  • 67
  • 810
  • 771
Mercer
  • 9,488
  • 27
  • 98
  • 165

3 Answers3

2
select * from table1 
         left join table2 
         on table1.id=table2.id 
         where table2.id is null
Shakti Singh
  • 81,083
  • 20
  • 131
  • 150
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
  • 55,302
  • 13
  • 128
  • 150
0

Should be something like this:

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