java - Alternative of ABS() in Mysql for JPA -


i have table like:-

+----+-------+ | id | score | +----+-------+ | 3  | -10   | | 2  | -11   | | 4  | -9    | | 5  | 1     | | 1  | 12    | +----+-------+ 

and expecting output

+----+-------+ | id | score | +----+-------+ | 1  | 12    | | 2  | -11   | | 3  | -10   | | 4  | -9    | | 5  | 1     | +----+-------+ 

although have query

select *    table  order         abs(score) desc; 


want replacement of jpql/jpa.

query query=em.createquery("select p product p abs(p.price)<50.0"); 

got source


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -