SELECT * FROM table ORDER BY FIELD( foo, 4, 2, 5, 1, 3 );