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