Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Another Query Problem
Sorry. You're right, it won't work. I'm thinking that you'd have to make use of PL/SQL to get what you want. I'm also thinking that the only way you can make use of just a single SQL statement is if you hard-code your strings in the statement, which I'm assuming isn't what you want to do. Of course, I may be wrong (again).
I've set up your tables in my system. I'll try to see if I can come up with something else.
arnold
In article <3A259D3E.7A94DFAA_at_yahoo.ca>,
Ted Wasserman <ted_wasserman_at_yahoo.ca> wrote:
> 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
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Nov 30 2000 - 11:14:33 CST
![]() |
![]() |