1
如何在HQL中編寫此查詢?如何在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 "(".