this is db2, right?
no idea why it isn’t working, it looks okay to me, but i don’t have db2 myself, so i can’t test this
select thecount
, days(TMSTP_COL) as days_timestmp
from (SELECT COUNT(*) as thecount
, TMSTP_COL
FROM MYTAB A
GROUP BY TMSTP_COL
HAVING COUNT(*) > 1) as dt
order by thecount desc
Discuss This Question: 5  Replies