Hi,
When i try the following query, i am getting the given result below.
db2 => SELECT DISTINCT ERRCODE, COUNT(ERRCODE) FROM DB2ADMIN.CFGERRLOG GROUP BY ERRCODE
ERRCODE 2
------------------------ -----------
AM2741 6
AM5569 4
IM0016 114
IM0043 129
IM0046 2
IM0048 188
IM0051 186
If i want to see ERRTEXT along with the above result, i am getting the given error below
db2 => SELECT DISTINCT ERRCODE, ERRTEXT, COUNT(ERRCODE) FROM DB2ADMIN.CFGERRLOG GROUP BY ERRCODE
Error:
SQL0119N An expression starting with "ERRTEXT" specified in a SELECT clause, HAVING clause, or ORDER BY clause is not specified in the GROUP BY clause or it is in a SELECT clause, HAVING clause, or ORDER BY clause with a column function and no GROUP BY clause is specified. SQLSTATE=42803
What could be the problem??
Please help me.
Thanks