[QUESTION] SQL*Plus: Joins

From: Frampton Steve R <3srf_at_qlink.queensu.ca>
Date: 1996/10/09
Message-ID: <53g78m$85f_at_knot.queensu.ca>#1/1


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.

What exactly am I doing wrong? :-(

Thanks...

---------------< LINUX: The choice of a GNU generation. >---------------

Steve Frampton                           http://qlink.queensu.ca/~3srf
Work: <frampton_at_mail.flarc.edu.on.ca> School: <3srf_at_qlink.queensu.ca> --< NOTICE! I do not accept unsolicited commercial e-mail messages! >-- Received on Wed Oct 09 1996 - 00:00:00 CEST

Original text of this message