Friday, 9 August 2013

Grails order with if

Grails order with if

I have issues with criteria.addOrder() in grails.
I have this table in mysql
ID TYPE NUMBER
1 INUSE 3333
2 NOTINUSE 2222
3 NOTINUSE 4444
4 INUSE 9999
And I can order this by using this query from mysql: select * from
phone_number order by type="NOTINUSE" desc, number;
Is it possible to order a table by giving it a value like NOTINUSE in this
example?

No comments:

Post a Comment