Tim Van Wassenhove

Passionate geek, interested in Technology. Proud father of two

09 Dec 2004

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.

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