I am having a table with a years data with the following columns:
Table "myData" ((
"Status" character varying,
"Project" character varying,
"Product" character varying,
"Identifier" character varying,
"Submittedon" date
)
etc.,
Now to fetch a count of records submitted on a particular month. Say like April 2013's Record count, I am using:
select count("Status") as April2013
from "myData"
where (
"SubmittedOn" > (current_date - 90)
and "SubmittedOn" < (current_date - 60)
)
Result:
April2013
--------
62
Now my requirement is to fetch the count of records for the past 6 months. I mean i want my output in any of the below formats:
FORMAT 1:
FORMAT 2:
6MonthsCount
-------------
34
23
44
41
18
9
GROUP BY
clause. – eggyal 48 mins ago