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: Count

Re: Count

From: Gary SMITH <Gary.Smith_at_cern.ch>
Date: Tue, 18 Aug 1998 09:31:24 +0200
Message-ID: <35D92DCB.CE204F2E@cern.ch>


You can use an in-line view as follows

select count(*)
from (select distinct field1, field2, field3||field4, field5, etc.)

            from some_tables
            where something=something);

This should do the trick.

Regards

Ivan Bajon wrote:

> I'm having problems formulating a select statement with the count function.
> I have a query where a lot of columns are selected - some of which are
> concatenated. I can't write:
>
> select count(distinct field1, field2, field3||field4, field5, etc.)
> from some_tables
> where something=something
>
> I tried taking the original select statement and putting a count around it
> but I can't seem to make it work. All I want to know is how many rows will
> be selected. I bet there's a beatiful way of formulating this. Would anyone
> care to comment please?
>
> - Ivan Bajon

--



Gary Smith
CERN, Geneva, Switzerland
Email: Gary.Smith_at_cern.ch
Tel: +41 22 7673416
Received on Tue Aug 18 1998 - 02:31:24 CDT

Original text of this message

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