hiredates [message #373240] |
Thu, 05 April 2001 16:11 |
prat
Messages: 4 Registered: April 2001 Location: INDIA
|
Junior Member |
|
|
create a query that will display the total number of employees and of that total the number who were hired in 1980,1981,1982,1983.
|
|
|
Re: hiredates [message #373245 is a reply to message #373240] |
Thu, 05 April 2001 18:37 |
kavithask
Messages: 34 Registered: March 2001 Location: London
|
Member |
|
|
Hi,
The following select will fetch you rows for each year and for all years in total.
Here goes:
SELECT TO_CHAR(hire_date, 'YYYY'), COUNT(*)
FROM emp
GROUP BY TO_CHAR(hire_date, 'YYYY')
UNION
SELECT 'ALL', COUNT(*)
FROM emp
/
HTH
Kavitha
|
|
|