0
一個能寫HQL以及使用標準或谷歌API的generalDaoHibernate查詢:順序按時間差
SELECT id,
CASE WHEN from_time > current_timestamp THEN (from_time - current_timestamp)
ELSE (current_timestamp - from_time)
END as a
FROM meetings order by a;
查看以下鏈接:https://docs.jboss.org/hibernate/orm/3.5/reference/en/html/queryhql.html#queryhql-expressions。這可能是你正在尋找的。 – Ambrish