$sql = "delete from sp where (select snum from sp a, supplier b where a.snum = b.snum AND a.snum = null)"; #if it has not_null then it would be a.snum = ''