I've got two tables that have one to many associations on a pmid
. So if one table has an pmid
, the second table should have multiple rows with the same pmid. However, something went sideways and I'm missing my latest batch of pmids in the second table. These queries, should help illustrate the problem, but I can't figure out how to get the ids from the first table that are actually missing in the second table.
select count(*) from abstract_mesh am; #2167101
select count(*) from abstract_mesh am
join abstracts a on am.pmid = a.pmid; #2133848
select 2167101 - 2133848; #33253
select count(*) from abstract_mesh where pmid is NULL; #33253
So as you can see there are 33,253 rows in abstract_mesh that have no pmids. I simply want to identify which pmids I should be interested in from the abstracts table.