Home » RDBMS Server » Server Administration » hiredates
hiredates [message #373240] Thu, 05 April 2001 16:11 Go to next message
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 Go to previous message
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
Previous Topic: Re: How do I know the version of Oracle of a Table?
Next Topic: Data is duplicated in the table when uploading to the SQL server ( Help?)
Goto Forum:
  


Current Time: Mon Jul 01 12:19:20 CDT 2024