Coba ini:
SELECT COL1,Max(COUNT_ID),Sum(SUM_MAX_COUNT) FROM(
SELECT COL1,
Count(*) AS COUNT_ID,
(SELECT Sum(Count(*))
FROM TABLE_NAME
GROUP BY COL1) AS SUM_MAX_COUNT
FROM TABLE_NAME
GROUP BY COL1)
GROUP BY COL1;
Coba ini:
SELECT COL1,Max(COUNT_ID),Sum(SUM_MAX_COUNT) FROM(
SELECT COL1,
Count(*) AS COUNT_ID,
(SELECT Sum(Count(*))
FROM TABLE_NAME
GROUP BY COL1) AS SUM_MAX_COUNT
FROM TABLE_NAME
GROUP BY COL1)
GROUP BY COL1;