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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Another Query Problem

Re: Another Query Problem

From: Ted Wasserman <ted_wasserman_at_yahoo.ca>
Date: Thu, 30 Nov 2000 00:20:14 +0000
Message-ID: <3A259D3E.7A94DFAA@yahoo.ca>

I tried this query and I couldn't get it to work. It may be that I'm not substituting in proper infd or it may be the version of SQL+ I'm using (for BTW is SQL*Plus: Release 8.1.5.0.0) or if the query is somehow flawed. I would appreciate if anyone else could take a look at this and see if they can make sense of it all. Again, what i'm looking for is a query that will return how many times each value (in this case character strings) appear in 3 columns of a table. (& the additional constraint of only returning the character strings (& the # of occurences) that are greater or equal to 3).

Thanks Again!

aqs472_at_my-deja.com wrote:

> hope this should help
>
> select a.string, b.qty + c.qty + d.qty
> from tbl_of_unique_strings a
> ,(select count(*) qty from first_tbl where x = a.string) b
> ,(select count(*) qty from first_tbl where y = a.string) c
> ,(select count(*) qty from first_tbl where z = a.string) d
> where b.qty + c.qty + d.qty >= 3
>
> cheers,
> arnold
Received on Wed Nov 29 2000 - 18:20:14 CST

Original text of this message

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