Date [message #296500] |
Mon, 28 January 2008 00:29  |
ramyashree.rp
Messages: 9 Registered: January 2007
|
Junior Member |
|
|
Hi,
can anybody please help me how to print the count of records month wise?
ex:
Month Count
----- -----
Jan 2007 5
Jan 2008 6
|
|
|
|
Re: Date [message #296513 is a reply to message #296500] |
Mon, 28 January 2008 00:57   |
ramyashree.rp
Messages: 9 Registered: January 2007
|
Junior Member |
|
|
i have used this but i am getting different output.
ex:
month count
----- -----
jan2007 1
jan2007 1
....
but i want the month to print only once and the total count.
|
|
|
Re: Date [message #296516 is a reply to message #296513] |
Mon, 28 January 2008 01:01   |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Show us the query.
Do a copy from your sql-plus session and paste it here.
Surround it (in your post) with [code] and [/code] tags to make it more readable.
|
|
|
Re: Date [message #296549 is a reply to message #296500] |
Mon, 28 January 2008 02:49   |
ramyashree.rp
Messages: 9 Registered: January 2007
|
Junior Member |
|
|
select to_char(date_created,'mon') "month",count(emp_id)from emp
where to_char(date_created,'Mon') = 'Jan'
group by to_char(date_created,'mon'),emp_id
|
|
|
Re: Date [message #296551 is a reply to message #296549] |
Mon, 28 January 2008 02:52   |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
Don't group by empid.
You might want to have a look at the documentation and do a bit of research.
this site contains the documentation that you will need, check out the SQL reference
|
|
|
|
|
|