SQL ORDER BY defined value list?

admin

Administrator
Staff member
Ok folks, something a little strange here but someone somewhere must know or have an idea on how to do this.

How would I do an ORDER BY on a SELECT query where I could say do an ORDER BY column("Val 2", "Val 6", "Val 1")

Basically specify the column to order by AND specify the values to order by in order.

i.e.

Say I have a table games,
it has columns: id, name, type, system

So I want to do
SELECT * from games ORDER BY publisher("PSX","N64","Dreamcast","SNES","PS2")


So that the output would be ordered;
PSX games then
N64 games then
Dreamcast games etc..

Is there a way to do this??
 
Back
Top