Results 1 to 4 of 4

Thread: Looking for query that displays Tot. no. of employes month wise

  1. #1
    Junior Member
    Join Date
    Jul 2007
    Answers
    1

    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.


  2. #2
    Contributing Member
    Join Date
    Apr 2006
    Answers
    46

    Re: Looking for query that displays Tot. no. of employes month wise

    give some sample data


  3. #3
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Looking for query that displays Tot. no. of employes month wise

    Can you post your table structure for my reference ,please.


  4. #4
    Expert Member
    Join Date
    Jun 2006
    Answers
    410

    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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact