-119   A COLUMN OR EXPRESSION IN A HAVING CLAUSE IS NOT VALID

Explanation

A column or expression identified in a HAVING clause, possibly within a scalar function, does not appear in the GROUP BY clause. Columns or expressions specified in a HAVING clause must appear within aggregate functions or also be specified in the GROUP BY clause.

Grouping expressions can be used in a search condition in a HAVING clause. A grouping expression specifies only one value for each group. A grouping expression specified in this context must exactly match a grouping expression specified in the GROUP BY clause, with the exception of blanks, which are not significant.

System action

The statement cannot be processed.

Programmer response

The implied function is not supported by DB2®.

SQLSTATE

42803