Re: [QUESTION] SQL*Plus: Joins

From: varad acharya <vacharya.ford_at_e-mail.com>
Date: 1996/10/09
Message-ID: <325BAF33.67E7_at_e-mail.com>#1/1


Frampton Steve R wrote:
>
> Hello:
>
> What is the proper way of doing something like this:
>
> select count(a.employee_id) male, count(b.employee_id) female
> from employee_table a, employee_table b
> where a.gender = 'M'
> and b.gender = 'F';
>
> The statement as above return huge values that do not represent
> actual counts. If the statement is broken up into two select
> statements, the correct numbers are returned.
>

Try doing it this war

select gender,count(*) from employee
group by gender;

-- 

Regards,

Varad Acharya
Received on Wed Oct 09 1996 - 00:00:00 CEST

Original text of this message