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

Home -> Community -> Usenet -> c.d.o.server -> Re: little sql syntax question

Re: little sql syntax question

From: Jonathan Gennick <jonathan_at_gennick.com>
Date: 2000/04/17
Message-ID: <39037116.41897204@netnews.worldnet.att.net>#1/1

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



jonathan_at_gennick.com
http://gennick.com
Brighten the Corner Where You Are

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

Original text of this message

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