Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Group by problem

Group by problem

From: Csillag Zsolt <starsoft_at_interware.hu>
Date: Fri, 05 Oct 2001 10:01:34 -0700
Message-ID: <F001.003A3A42.20011005095029@fatcity.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US