Identifying values that are not existent in other table
These are pmid values that are in abstracts but not in abstract_mesh

select a.pmid from abstracts a
left join abstract_mesh am on a.pmid = am.pmid
where am.pmid is null;


or

select a.pmid from abstracts a
left join abstract_mesh am using (pmid)
where am.pmid is null;