Hi
i am using hibernate 3.2.2. i have a field in database which is stored as integer but we are converting that into a string value in the front end according to our requirement. the numbers given in the database is not in alphabetical order. (Ex: 1 for M, 2 for N, 3 for G etc). now i need to sort the values according to the alphabetical order. i have got an sql query for that but can anyone help me on how to implement this with criteria?
the query is
select * from org order by locate(cast(ORG_ID as char(1)),'831427')
i'm using DB2 v8.2 as the database
Thanks in advance
Sudeep
|