如何在 HQL 中编写此查询?
SELECT CASE WHEN data1 > data2 THEN data1 ELSE data2 END AS data, STAMP FROM
(SELECT STAMP, max(mc.data1) as data1, max(mc.data2) as data2 FROM
transaction_history mc LEFT JOIN orderdetails gc on mc.id = gc.id where
gc.order_name in ('xxx','yyy') AND time >= 135689 AND time <= 137692) AS TBL
当我尝试在 HQL 中复制上述查询时,我得到:
org.hibernate.hql.ast.QuerySyntaxException exception saying unexpected token "(".