Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: nested dbi queries question

by Grundle (Scribe)
on Feb 01, 2005 at 22:43 UTC ( #427085=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://427085]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2022-06-27 06:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (86 votes). Check out past polls.

    Notices?