All pastes #205389 Raw Edit

lol

public text v1 · immutable
#205389 ·published 2006-10-16 19:31 UTC
rendered paste body
My query:
ORDER BY binary FIELD(`oflags`,'N','a','A','C','o','O','h'), `usermodes`, `nick`

My question:

I want to order oflags that it will sort like N first, then lowercase a, followed by A next up is C then its up to lowercase o and then uppercase O and last lowercase h

My db structure:
oflags  varchar(100) latin1_swedish_ci 

My full query:
SELECT `nick`,`server`,`usermodes`,`oflags`,`timestamp` from `users_on` where `server` not like 'services%' AND `server` not like 'oper%' AND `server` not like 'blackbox%' ORDER BY binary FIELD(`oflags`,'N','a','A','C','o','O','h'), `usermodes`, `nick`