mysql - Extracting records not found on another table -
i have table...
id name location date_created -- ---- -------- ------------ 15641 maybel new york 2015-09-15 84194 joseph arkansas 2015-02-03 36479 frank illinois 2015-10-28 19804 samantha san francisco 2015-11-05 67811 charles texas 2015-11-05
... , table...
id name location created_at -- ---- -------- ---------- 15641 maybel new york 2015-09-15 84194 joseph arkansas 2015-02-03 36479 frank illinois 2015-10-28 78916 logan philadelphia 2015-12-01 26799 george mississippi 2015-12-10
and need is...
id name location created_at -- ---- -------- ---------- 19804 samantha san francisco 2015-11-05 67811 charles texas 2015-11-05
so need query show records on table 1 not found in table 2. thanks!
you can use this
select * table1 id not in (select id table2)
Comments
Post a Comment