Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Another Query Problem
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