I am a newbie in both SQL and BigQuery. I have a problem which to find records that do not exist on the other table.
Suppose I have table A which contains complete data and it has its own timestamp when the records were inserted, and Table B which does insert snapshot data of that day of table A.
My 1st query with "LEFT OUTER JOIN" per below:
select count(1)
from table_a a
left outer join table_b b on (a.id =b.id)
where b.id is null
using above SQL which returned 0 results
and SQL below with "NOT EXIST":
select count(1)
from table_a a
where not exists (
select 1
from table_b b
where a.id = b.id
)
which return many records.
Now I am confused about which SQL that telling me the truth because I believe that Table B had missed one or two days of sync from Table A. How can I tell there are missing records is because I use several sample IDs on Table A that did not exist on Table B.


