Skip to content

# Three wishes for a new year

MySQL SQL September 9, 2010

It’s a new year by Jewish calendar (and, incidently, today is the first day of the next 365 days). And what do I wish for in the following year?

1. World peace
2. Good health to all
3. Support for ORDER BY & LIMIT in MySQL multi-table UPDATE and DELETE statements, This is sometimes a real show stopper!

Have a good year / next 12 months everyone!

- Twitter
- LinkedIn
- WhatsApp
- Email
- Facebook
- Print

###
6
Leave a Reply

6 Comment threads
0 Thread replies
0 Followers
Most reacted comment
Hottest comment thread
3 Comment authors
Recent comment authors

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe
Notify of
Guest
Justin Swanhart

I have a user-variable abusing method for Multi-table delete + LIMIT. I think I’ve only tested it for deleting from one table, but where that table needs to be joined to other tables.

Guest
Justin Swanhart

Oh, I forgot that I blogged about that before:
http://swanhart.livejournal.com/120806.html

Guest
Yaron

Amen to that! 🙂

Author
shlomi

@Justin: thanks for the reference!

Author
shlomi

@Justin,
As another note: there is a problem with applying your solution, which does not (and cannot) use ORDER BY, since queries become replication-unsafe.
Actually, it may not bee such a problem if you want to do complete query is smaller chunks, in which case the ORDER does not really matter, replication-wise. But I can still see it leading to issues if new rows are added which match the DELETE/UPDATE WHERE condition.

MySQL foreach() | code.openark.org

[…] does not support ORDER BY & LIMIT in multi-table UPDATE and DELETE statements (as noted last year). So we […]

wpDiscuz
Send to Email Address Your Name Your Email Address Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.