--根据日期分组---------------------------------------------------
SELECT
to_char(to_date(XXXX, 'yyyymmdd'), 'yyyy-mm-dd')
FROM XXXXX
GROUP BY
to_char(to_date(XXXX, 'yyyymmdd'), 'yyyy-mm-dd')
--根据月份分组---------------------------------------------------
SELECT
to_char(to_date(XXXX, 'yyyymmdd'), 'yyyy-mm‘’)
FROM XXXXX
GROUP BY
to_char(to_date(XXXX, 'yyyymmdd'), 'yyyy-mm')
--根据年分组---------------------------------------------------
SELECT
to_char(to_date(XXXX, 'yyyymmdd'), 'yyyy‘’)
FROM XXXXX
GROUP BY
to_char(to_date(XXXX, 'yyyymmdd'), 'yyyy')