Order by in is not giving exact sorted reults in JPA
996208Mar 12 2013 — edited Mar 14 2013Hi I have wrote a query in sql server like --> Select * from table order by columnName asc
here I am getting records starting with 'AA' eg: AA i dont know why it is coming, but after searching some forums i have got a solution like
select * from tablename order by lower(columnName) Collate SQL_Latin1_General_CP850_BIN asc
is is giving correct results to me, but i nned to write this syntax in JPA , when apply collate syntax in JPA query it is not supprting
JPA query:
this.createQuery(select * from tableaName t order by lower(t.columnname) collate SQL_Latin1_General_CP850_BIN asc).getResultList();
Can some one give me some suggessitions how this collate work exactly and how to appy this in JPA query.
Thanks in Advance :)