Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Group by problem
Hi,
If I have the following query:
Select a.column1, count(*)
from a, b
where a.column2 = b.column2
It works correctly, it displays the correct number in the count.
However there are records that don't meet the criteria 'where a.column2 = b.column2'
So I modified the query:
Select a.column1, count(*)
from a, b
where a.column2 = b.column2(+)
Now with (+) it displays every record, but the problem is that in case there is no relation, the count displays 1 instead of 0. In other cases it is good.
But I can't decide from the program if it's 1 because it had 1 relation in
table b, or 1 because it hadn't
got any relation.
Can you help me work around this problem?
Thank you
Zsolt Csillag
Hungary
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Csillag Zsolt
INET: starsoft_at_interware.hu
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri Oct 05 2001 - 12:01:34 CDT
![]() |
![]() |