Custom ordering with MySQL

As a follow up to Custom Ordering I discovered the nice Field function in MySQL. after it was mentionned on my favorite PHP Forum by Weirdan. It allows one to order a column on a custom order relation.

SELECT *
FROM foo
ORDER BY FIELD(column, 'Z', 'B', 'C')

This entry was posted on Thursday, December 9th, 2004 at 01:10 and is filed under SQL. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.