Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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
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.

Reaped: Re^2: MySQL DELETE with INNER JOIN
by NodeReaper (Curate) on Dec 06, 2012 at 07:17 UTC

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 taking refuge in the Monastery: (15)
As of 2014-08-27 19:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (250 votes), past polls