mySQL can't do subselects afaik Etienne
Harlan Feinstein wrote: > > Rory> I want to write an efficient query that will delete all records > Rory> from one table when they show up in another table (pending > Rory> shipments --> shipped shipments). I can't do it with this: > > mysql> DELETE from pending_2 WHERE pending_2.ordno = ordersearch_2.ordno; > > Rory> because you can only refer to columns of one table in a delete > Rory> query. Does anybody have an effiecnt way for me to do this with > Rory> Perl DBI? > > This isn't really a Perl question, is it? Isn't the most efficient way to > have the DB handle all of it? Something like: > > DELETE FROM pending_2 WHERE ordno IN > (SELECT ordno FROM ordersearch_2) > > --Harlan > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- Etienne Marcotte Specifications Management - Quality Control Imperial Tobacco Ltd. - Montreal (Qc) Canada 514.932.6161 x.4001 --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php