Thursday 10 September 2015

Create a query to display the total number of employees and, of that total, the number of employees hired in 1995, 1996, 1997, and 1998. Create appropriate column headings

Create a query to display the total number of employees and, of that total, the number of
employees hired in 1995, 1996, 1997, and 1998. Create appropriate column headings


select count(DECODE (to_char(hire_date,'YYYY'), '2005',  'test'))Yr2005,
count(DECODE (to_char(hire_date,'YYYY'), '2006', 'test'))Yr2006,
count(DECODE (to_char(hire_date,'YYYY'), '2007', 'test'))Yr2007,
count(DECODE (to_char(hire_date,'YYYY'), '2008', 'test'))Yr2008
from employees
where to_char(hire_date,'YYYY') in ('2005','2006','2007','2008')

No comments:

Post a Comment