in reply to Re: nested dbi queries question
in thread nested dbi queries question

that sql didn't move the rows i also tried $sql = "SELECT * INTO sp_err FROM sp WHERE NOT EXISTS ( SELECT * FROM sp, supplier WHERE sp.snum = supplier.snum)";

Replies are listed 'Best First'.
Re^3: nested dbi queries question
by runrig (Abbot) on Feb 02, 2005 at 00:11 UTC
    VSarkiss's sql statement without the 'INTO sp_err' clause should be selecting the rows you want. It's up to you to tweak it so that it is selecting those rows into the sp_err table. That depends on the database (which you haven't told us what it is). Maybe it's not exactly 'INTO sp_err', maybe it's 'INSERT INTO sp_err (select statement here)' (I'm betting on that). The select statement itself, though, should be correct.