I have two tables, one has primary key other has it as a foreign key.
I want to pull data from the primary table, only if the secondary table does not
SELECT P.* FROM primary_table P LEFT JOIN secondary_table S on P.id = S.p_id WHERE S.p_id IS NULL