Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: (OT) MySQL: delete from multiple tables

by bpphillips (Friar)
on Mar 14, 2005 at 18:06 UTC ( [id://439386]=note: print w/replies, xml ) Need Help??


in reply to (OT) MySQL: delete from multiple tables

as noted above, this isn't the best place for SQL questions but here's how you would do that in recent (>= 4.0) versions of MySQL:
DELETE FROM table1, table2, table3 USING table1 INNER JOIN table2 USING(data_id) INNER JOIN table3 USING(data_id) WHERE table1.data_id = 111
Starting in MySQL 4.1 you can use table aliases (must be consistent in both the FROM and USING clauses

Replies are listed 'Best First'.
Re^2: (OT) MySQL: delete from multiple tables
by Anonymous Monk on May 28, 2013 at 08:29 UTC
    Thanks...this works

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-19 09:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found