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

Home -> Community -> Usenet -> c.d.o.misc -> Re: count distinct

Re: count distinct

From: Andy Hassall <andy_at_andyh.co.uk>
Date: Thu, 24 Jun 2004 22:52:31 +0100
Message-ID: <8uimd0dd6uina2746unjjd1sjnooptcd9p@4ax.com>


On Wed, 23 Jun 2004 22:26:23 -0700, Daniel Morgan <damorgan_at_x.washington.edu> wrote:

>Romeo Olympia wrote:
>
>> Uh, why not this???
>>
>> select count(distinct column1), count(distinct column2),
>> count(distinct column3), count(distinct column4)
>> from mytable;
>
>Because it is totally unnecessary.
>http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_103a.htm#2065826

 Why is it unnecessary? Aggregate functions can have DISTINCT applied to the column they're aggregating, which would do what the OP is asking for. And this is different from the SELECT level DISTINCT clause you've linked to.

http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions26a.htm#82699

--
Andy Hassall <andy_at_andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk         / http://www.andyhsoftware.co.uk/space
Received on Thu Jun 24 2004 - 16:52:31 CDT

Original text of this message

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