Reputation: 139
I have the follow instruction on SQL ORACLE:
SELECT COUNT(FE_DAY)
FROM TI_DATE
WHERE (FE_MO = 02 AND FE_YEAR in ('2011', '2012'))
GROUP BY FE_DAY
In this instruction effectively obtain like SQL Answer a list of number that they sum=10 .But How can I don't show rows .I need only show the row's sum=10
I tried to apply the follow SQL instruction also:
SELECT SUM(COUNT(FE_DAY))
FROM TI_DATE
WHERE (FE_MO = 02 AND FE_YEAR in ('2011', '2012'))
GROUP BY FE_DAY
But the answer was 57, different of the number of rows, that I need.
Upvotes: 0
Views: 1412
Reputation: 183241
If I understand correctly what you want, you actually don't need the GROUP BY
clause; you can just write:
SELECT COUNT(1)
FROM ti_date
WHERE fe_mo = 2
AND fe_year IN ('2011', '2012')
;
Upvotes: 3