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

Home -> Community -> Usenet -> c.d.o.tools -> returning records with count grouping

returning records with count grouping

From: <mansoorzaidi_at_my-deja.com>
Date: Mon, 14 Aug 2000 20:56:44 GMT
Message-ID: <8n9mea$i19$1@nnrp1.deja.com>

Hello all,

I hope somebody can help with this problem I'm having.

Basically, whenever you use count(*) with a single grouping, you always get a number back. So, for instance, if there was no record on table blah where column firstname equaled "mansoor", then this count would return a zero

"select count(*) from blah where firstname = 'mansoor'"

would get:

COUNT(*)


       0

Now, I can group and try to get a total count by using count like this:

"select count(*), firstname from blah where firstname = 'mansoor' group
by firstname"

but Oracle will reply with "no rows selected"

Is there any way in which I can force Oracle to give back a record something along the lines of:

COUNT(*) FIRSTNAME
-------- ---------

       0 mansoor

Any help in this matter is appreciated. Thank you.

Mansoor Zaidi

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Aug 14 2000 - 15:56:44 CDT

Original text of this message

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