Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: little sql syntax question
Perhaps you could try this:
select a,b,count(c)
from table
group by a,b;
This should give you the number of distinct a+b combinations. I'm fairly certain that only non-null Cs will be counted. You might be able to use count(*) to count the nulls as well. Test it both ways to be sure.
Jonathan
On Sat, 15 Apr 2000 22:13:33 GMT, dcowles_at_i84.net (Doug Cowles) wrote:
>Or, I could do a select count(distinct(b||c)) from table A; (to
>compare it with the count of the table).
>This is my question.. why the ||? It would seem I can't do a select
>distinct (b,c) from A. Am I really reduced to a string comparison? Or
>is there another way? Hope this isn't to obfuscated...
Received on Mon Apr 17 2000 - 00:00:00 CDT
![]() |
![]() |