如何修复当前工作的查询?
Query query = getSession().createQuery(
"FROM Rates WHERE amount =
(SELECT MIN(amount) FROM
(SELECT amount FROM Rates
GROUP BY amount having COUNT(*) = 1))");
IntellijIDE编译器显示
')', ',', FETCH, GROUP, HAVING, IN, ORDER, WHERE or identifier expected, got '(
并在此FROM (SELECT
(
答案 0 :(得分:0)
如果我理解您的请求,您可以尝试:
"FROM Rates r1 WHERE r1.amount in
(SELECT MIN(r2.amount) FROM Rates r2
GROUP BY r2.amount having COUNT(r2.amount) = 1))"
告诉我它是否正常