Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Count
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
--
![]() |
![]() |