in reply to nested dbi queries question

Why not just make an SQL DELETE statement? Something like the following?

$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 = ''


Is ther any reason why this wouldn't work?

Replies are listed 'Best First'.
Re^2: nested dbi queries question
by philosophia (Sexton) on Feb 01, 2005 at 23:19 UTC
    well, i am looking for rows in table sp where sp.snum does not exist in table suppliers. after i find these rows i have to move them (insert select) into table sp_err, then delete these rows out of table sp.