DELETE b FROM tbl LEFT JOIN rel ON rel.id = tbl.fileid WHERE rel.id IS NULL2. NOT EXISTS
DELETE FROM tbl WHERE NOT EXISTS(SELECT NULL FROM rel WHERE rel.id = tbl.fileid)3. NOT IN
DELETE FROM tbl WHERE tbl.fileid NOT IN (SELECT rel.id FROM rel)
DELETE b FROM tbl LEFT JOIN rel ON rel.id = tbl.fileid WHERE rel.id IS NULL2. NOT EXISTS
DELETE FROM tbl WHERE NOT EXISTS(SELECT NULL FROM rel WHERE rel.id = tbl.fileid)3. NOT IN
DELETE FROM tbl WHERE tbl.fileid NOT IN (SELECT rel.id FROM rel)