我正在使用以下 NamedQuery 但出现错误
@NamedQueries({
@NamedQuery(name="getAvailableAmount", query="SELECT sum(tup.tran_amount) FROM TopUpResponse tup"),
@NamedQuery(name="getUpFrontDiscount", query="SELECT (sum( abs( tup.tran_amount) )*.04) FROM TopUpResponse tup WHERE tup.service='BILLPAYMENT'")
})
内部异常:FailedPredicateException(arithmeticPrimary,{ aggregatesAllowed() }?)
我尝试了以下格式但仍然出现错误
SELECT FUNC('ABS',tup.tran_amount) FROM TopUpResponse tup
异常描述:语法错误解析查询 [getAvailableAmount: SELECT FUNC('ABS',tup.tran_amount) FROM TopUpResponse tup],第 1 行,第 11 列:[(] 处的语法错误。内部异常:MismatchedTokenException(81!=32)
问候, 伊姆兰