Deleting multiple tables in MySQL

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
tonykasdorf
Forum Newbie
Posts: 6
Joined: Wed Mar 31, 2010 7:13 am

Deleting multiple tables in MySQL

Post by tonykasdorf »

I'm trying to delete records from multiple tables in MySQL but seem to be running into problems. Below is my script.

Code: Select all

DELETE FROM product, prod_paper_link
USING product p, prod_paper_link pp
WHERE p.product_id = pp.product_id AND pp.product_id = 2
(product = table 1, prod_paper_link = table 2).
Could someone let me know what is incorrect with this script. Let me know if you need more information.
Last edited by Benjamin on Sat Apr 10, 2010 12:28 pm, edited 1 time in total.
Reason: Added [syntax=sql] tags.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Deleting multiple tables in MySQL

Post by Benjamin »

:arrow: Moved to Databases
Post Reply