Given the following query:
SELECT DISTINCT n.iswinner, i.name
FROM nominees n, institutions i
WHERE n.iid = i.iid and n.filmname = '127 Hours'
ORDER BY name
I get the output:
iswinner name
NULL academy awards
NULL baftas
NULL critics' choice awards
NULL golden globes
NULL screen actors guild
NULL writers guild of america
I am trying to figure out if it is possible to order this output in a more specific manner. The order I am looking for is to list first 'academy awards', then 'golden globes' then anything with a 'guild' in its name, and finally anything else alphabetically. So therefore the output I'm looking for is more along the lines of this:
iswinner name
NULL academy awards
NULL golden globes
NULL screen actors guild
NULL writers guild of america
NULL bafta
NULL critics' choice awards
Is there a way to do such a thing? I believe I should use something like CASE, but I couldn't seem to figure out the correct syntax for it. Thanks for any help.
fieldis MySQL-specific.