
- Forum
- Databases
- SQL Looking for query that displays Tot. no. of employes month wise
-
Junior Member
Looking for query that displays Tot. no. of employes month wise
Hi guys pleas eanswer this question for me.
I am looking for query that displays total number of employess and the total number of employees month wise.
I wrote the following query for the total number of employeed in the month of dec.
SQL> select count(*) Total, count(decode(to_char(hiredate,'MONTH'),'DECEMBER',empno)) DEC from emp;
TOTAL DEC
---------- ----------
14 0
even though there are number fo employess in the month of dec it is giving me ')' in the output.
Please help me.
-
Contributing Member
Re: Looking for query that displays Tot. no. of employes month wise
-
Re: Looking for query that displays Tot. no. of employes month wise
Can you post your table structure for my reference ,please.
-
Expert Member
Re: Looking for query that displays Tot. no. of employes month wise
hay use either of these queries,
select count(*) Total, sum(decode(to_char(hiredate,'MONTH'),'DECEMBER',1,0)) DEC from emp;
select count(*) Total, count(decode(to_char(hiredate,'MONTH'),'DECEMBER',1,null)) DEC from emp;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules