Hi,
You can try the below sample query to get the required output.
select count(*) Total,
count(decode(to_char(hiredate,'yyyy'),1980,1)) Year80,
count(decode(to_char(hiredate,'yyyy'),1981,1)) Year81,
count(decode(to_char(hiredate,'yyyy'),1982,1)) Year82,
count(decode(to_char(hiredate,'yyyy'),1987,1)) Year87
from emp
Karthik
-----Original Message-----
From: Gururaj
[mailto:oracledba-ezmlmshield-x54604100.[Email address protected]
Sent: Wednesday, December 29, 2004 6:33 PM
To: LazyDBA Discussion
Subject: Doubt in Group-By Query
Hi,
I have small doubt in Group By query.
I want to display the total number of employees and, of that total, the
number of employees hired in 1995,1996,1997 and 1998.
i.e it should look like this..
TOTAL 1995 1996 1997 1998
20 1 3 4 5
Please help me asap.
Thanks & Regards,
Gururaj.C.M.
Software Engineer,
BLUE CHIP COMPUTER CONSULTANTS PRIVATE LTD.,
Mobile No: +919845580082
!-- Virus-Free Mail Using PostMaster Enterprise AvAc & QuickHeal Engine
--!
-------------------------------------------------------
Bluechip Computer Consultants Pvt Ltd, Bangalore, India
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
Confidentiality Statement:
This message is intended only for the individual or entity to which it is addressed. It may contain privileged, confidential information which is exempt from disclosure under applicable laws. If you are not the intended recipient, please note that you are strictly prohibited from disseminating or distributing this information (other than to the intended recipient) or copying this information. If you have received this communication in error, please notify us immediately by return email.
Oracle LazyDBA home page