Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> returning records with count grouping
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