Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: MySQL DELETE with INNER JOIN

by JavaFan (Canon)
on Mar 03, 2011 at 15:57 UTC ( #891251=note: print w/ replies, xml ) Need Help??


in reply to MySQL DELETE with INNER JOIN

mysql> DELETE ab, b -> FROM Authors AS a INNER JOIN AuthorArticle AS ab ON a.AuthID=ab +.AuthID -> INNER JOIN Articles AS b ON ab.ArticleID=b.ArticleID -> WHERE AuthorLastName='Tom'; Query OK, 0 rows affected (0.01 sec)
You may want to consider an example that actually deletes something.

But don't post it here. This site is about Perl, not MySQL. The MySQL documentation explains it in detail, giving alternative syntaxes as well.


Comment on Re: MySQL DELETE with INNER JOIN
Download Code
Replies are listed 'Best First'.
Re^2: MySQL DELETE with INNER JOIN
by lancer (Beadle) on Mar 03, 2011 at 16:26 UTC

    I know it doesn't work.

    I just think it is a good example, if the code can be fixed. I have done this once already, when I first saw this example on the net. Then it proved to be a very valuable learning resource for me.

    I needed this knowledge again today, so I've google'd it up.

    I decided to post it here so that others can learn from it. I know it's not Perl, but I remember reading here somewhere that about 5% of the posts can be off-topic, and, it's possible to use MySQL from Perl, so I believe it can be useful to at least a few people on this site.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2015-08-05 09:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (80 votes), past polls