Scalar functions in GROUP BY
I have a table with a column that is of type timestamp. I want to get a count of all dates for which there are multiple rows. So I devise a query of the sort
SELECT COUNT(*), DAYS(TMSTP_COL)
FROM MYTAB A
GROUP BY DAYS(TMSTP_COL)
HAVING COUNT(*) > 1
ORDER BY COUNT(*) DESC
I get an error
DSNT408I SQLCODE = -104, ERROR: ILLEGAL SYMBOL "(".
I know it is complaining about the DAYS function since the moment I remove it, the error goes away
Thanks



