I am trying to execute the following db2 query, but I'm getting this error:
SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-119, SQLSTATE=42803, SQLERRMC=ENTITLEMENT
The query is:
SELECT *
FROM reclaimbalance rb
,user_benefit_accrued_period ubap
WHERE rb.user_id = ubap.user_id
AND rb.component_id = ubap.PAY_HEAD_ID
AND ubap.CUSTOMER_ID = 281
AND rb.year = '2016-2017'
AND ubap.STATUS = 1
GROUP BY ubap.user_id
,ubap.PAY_HEAD_ID
HAVING sum(ubap.STD_BALANCE_ADDED_IN_PERIOD) != rb.ENTITLEMENT
group byandhavingclauses but it's difficult to understand what your trying to do. - sgeddesSELECT *withGROUP BY; the select list must contain only the columns from theGROUP BYclause and aggregate functions. - mustaccio