标签: sql sorting spring-data spring-data-jpa
我不知道如何使用Pageable对象按计算列对列表进行排序。
Pageable
示例:
select qte, price, (price * qte ) as total from table order by total
答案 0 :(得分:0)
您无法在order by子句中引用别名。相反,你会使用:
SELECT qte, price, (price * qte) as total FROM table ORDER BY (price * qte)