Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Need help with query
Thanks Jay,
just what I was looking for.
Bob
Jay Weiland wrote:
> Hey Bob,
>
> It would look like:
>
> Select mega, count(*)
> from
> (select field1 mega from your_table_name
> UNION ALL
> select field2 mega from your_table_name
> UNION ALL
> select field3 mega from your_table_name)
> group by mega
> /
>
> ME COUNT(*)
> -- ---------
> a 4
> b 1
> c 2
> d 1
> e 1
>
> Jay!!!
>
> Bob McConnell wrote:
>
>> Hi,
>> I have a table with 3 fields and I need to count the data without
>> reguard to the field it is in.
>>
>> field1 filed2 field3
>> a b c
>> d c a
>> e a a
>>
>> I need to report that the count is
>> a 4
>> b 1
>> c 2
>> d 1
>> e 1
>>
>> Is this possible??
>>
>> thanks,
>> Bob
>
Received on Thu Dec 14 2000 - 15:16:49 CST