A query which should give output which has years as the column name and number of employee who hired in that year. Hire date will be their in column hire_date
.
I wrote a code its like
SELECT count(e.employee_id) total, count(a.employee_id) _2002, count(b.employee_id) _2003, count(c.employee_id) _2004, count(d.employee_id) _2005
FROM hr.employees e,
(select employee_id from hr.employees where extract(year from hire_date)=2002) a,
(select employee_id from hr.employees where extract(year from hire_date)=2003) b,
(select employee_id from hr.employees where extract(year from hire_date)=2004) c,
(select employee_id from hr.employees where extract(year from hire_date)=2005) d;
.
Its showing '0' in every column. Where i went wrong?
Note: data are present for all the conditions.