Is there any way I can delete in one table with information from another
table without doing as the following example?
SELECT column_name FROM table_1
"result = 1,2,3"
DELETE FROM table_2 WHERE column_name = 1
DELETE FROM table_2 WHERE column_name = 2
DELETE FROM table_2 WHERE column_name = 3
Regards,
Johan Nilsson
Software Developer
BeCon Mobile Internet AB, Sweden
E-Mail: [EMAIL PROTECTED]
Web: http://www.beconmobile.com
> -----Ursprungligt meddelande-----
> Fran: Sinisa Milivojevic [mailto:[EMAIL PROTECTED]]
> Skickat: den 27 juni 2001 14:27
> Till: [EMAIL PROTECTED]
> Kopia: [EMAIL PROTECTED]
> Amne: Re: Delete in many tables
>
>
> Johan Nilsson writes:
> > Hi,
> >
> > I have a problem when I shall delete some records (more than one) from a
> > couple of tables which has relations between each other.
> >
> > One whay to do this and it's to select all elements I want to
> delete from
> > the "primary table" and then delete from the "secondary table" and then
> > later on delete from the primary table, but that is one delete
> query/row? Is
> > there any smart way to do this?
> >
> > Can I user temporary tables when deleting? INSERT...SELECT works but I
> > havn't figured out how to use this temporary table in a DELETE query (I
> > don't think it's possible)?
> >
> > Regards,
> > Johan Nilsson
> > Software Developer
> > BeCon Mobile Internet AB, Sweden
> > E-Mail: [EMAIL PROTECTED]
> > Web: http://www.beconmobile.com
>
>
> DELETE's from multiple tables is in beta testing in 4.0 branch.
>
> And 4.0 will most probably be released in August.
>
> --
> 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