Jeremy Zawodny writes:
> On Wed, Jan 23, 2002 at 11:25:31PM -0500, Jason Yates wrote:
> > Heres an example scenario, say I have two tables
> > 
> >        table1
> > ----->      id
> > |   name
> > |
> > |       table2
> > |_____> id 
> >     address
> >     zip
> > 
> > I inner join table1 and table2 on id.  I want to delete all the
> > records in table1 which have a zip of '90210'.
> 
> Good choice.  90210 is first to go on my list, too. :-)
> 
> > I could create a script, run a select and loop through each id and
> > delete the records in table1.
> 
> If you're running MySQL 4.x, multi-table deletes:
> 
>   http://www.mysql.com/doc/D/E/DELETE.html
> 
> may be what you need, if I understand you right.
> 
> Otherwise, you've gotta write that loop.
> 
> Jeremy
> -- 
> Jeremy D. Zawodny, <[EMAIL PROTECTED]>
> Technical Yahoo - Yahoo Finance
> Desk: (408) 349-7878   Fax: (408) 349-5454   Cell: (408) 685-5936
> 
> MySQL 3.23.41-max: up 22 days, processed 514,844,619 queries (266/sec. avg)
> 


Or use multi-table delete feature from  4.0.1 ... 

-- 
Regards,
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Sinisa Milivojevic <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Fulltime Developer
/_/  /_/\_, /___/\___\_\___/   Larnaca, Cyprus
       <___/   www.mysql.com


---------------------------------------------------------------------
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

Reply via email to