ramki067 — 2010-11-30T01:15:35-05:00 — #1
I've 4 tables from which i need to delete rows. Below are the tables:
- Column a_sid of table "a" references column s_id of table "s" where s_id is primary key so as a_sid.
- Column v_sid of table "v" references column s_id of table "s"
- Column p_sid of table "p" references column s_id of table "s"
I need to delete all rows of 4 tables where a_type of "a" table = "AC"
guido2004 — 2010-11-30T02:08:52-05:00 — #2
From the manual:
DELETE t1, t2, t3 FROM t1 INNER JOIN t2 INNER JOIN t3
You just need to change it a bit and adapt it to your situation
ramki067 — 2010-11-30T03:13:48-05:00 — #3
Thanks guido. It worked
r937 — 2010-11-30T03:23:43-05:00 — #4
eeeeeeeeewwwwwwwwwwwwww!!!!!! :mad: :mad: :mad:
i didn't believe it until looked it up, and that is indeed what it says
please, let's not ever show anyone that particular example again
instead, let's show them this --
DELETE t1, t2, t3
<font color='"Blue"'>[B]ON[/B]</font> t2.id = t1.id
<font color='"Blue"'>[B]ON[/B]</font> t3.id = t1.id
guido2004 — 2010-11-30T03:29:17-05:00 — #5
You know, I had some doubts, so I read it twice and looked at the whole page in search of some 'ON' clause, but there wasn't, so I assumed in the case of multiple table deletes the MySQL syntax was different...
I'm glad you confirm my doubts