Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

To get the count of employees joined for the last 3 years, month_year wise

880216Dec 29 2011 — edited Jan 4 2012
select emp_id,count(emp_id),TO_CHAR (join_date, 'MON')|| ' '|| TO_CHAR (join_date, 'YYYY') month_year
from employee
where TRUNC (MONTHS_BETWEEN (SYSDATE, join_date)) < 36
group by emp_id,TO_CHAR (join_date, 'MON')|| ' '|| TO_CHAR (join_date, 'YYYY');

To get the count of employees joined for the last 3 years, month_year wise. It gives me output but I need those months also when no employee joined with count as zero. How can I do it.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 1 2012
Added on Dec 29 2011
7 comments
4,024 views