[HOW TO] Natural sorting 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
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

[HOW TO] Natural sorting in MySQL

Post by pickle »

I found this blog post today - it worked for me and seems really helpful & not everyone would think of. It allows natural sorting in MySQL:

http://blog.feedmarker.com/2006/02/01/h ... -in-mysql/
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: [HOW TO] Natural sorting in MySQL

Post by Weirdan »

It's not real natsort though. drupal's natsort for mysql is much better suited for sorting mixed alphanumeric data.
Post Reply