Results 1 to 3 of 3

Thread: Rerieve data from single column table

  1. #1
    Junior Member
    Join Date
    Jan 2008
    Answers
    1

    Rerieve data from single column table

    Hi,
    I have a table called 'T1' in that i have column like 'Gender', in that column i have 'male' and 'female' values. How to retrieve count(male) and count(Female) from T1.

    Last edited by admin; 02-15-2008 at 07:23 AM.

  2. #2
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    Re: Rerieve data from single column table

    Select sum (decode (sex,'male', 1,0)) MALE, sum (decode (sex,'female', 1,0)) FEMALE , count (decode (sex,'M', 1,'F', 1)) TOTAL from t1;


  3. #3
    Expert Member
    Join Date
    Apr 2007
    Answers
    500

    Re: Rerieve data from single column table

    Try this one also
    select gender,coun(*) from t1 group by gender;


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