Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Need help for writing a query
In our last gripping episode "spencer" <spencerp_at_swbell.net> wrote:
> > Why go through all of that work when the following returns the
proper
> > result set:
> >
> > select player
> > from player_games
> > where game = 'FOOTBALL'
> > union
> > select player
> > from player_games
> > where game = 'RUGBY'
> >
>
> maybe because this query does not return an aqccurate result
> set. we go through the work to get a result set that satisfies the
> criteria "players that play BOTH football and rugby".
>
> simplicity is to be lauded, but not at the expense of accuracy.
> perhaps you intended to use the INTERSECT set operator in
> place of the UNION operator ? I specifically avoided the use of
> the operator because of problems we experienced with queries
> containing INTERSECT that returned inaccurate result sets.
>
>
Apparently the point is moot since neither query will satisfy the requirements subsequently posted.
With a varying string of possibilities it appears to me to be a case suited to PL/SQL which puts a different spin on things. In my spare time I am working on such a solution, however I will not be offended should anyone find it sooner.
-- David Fitzjarrell Oracle Certified DBA Sent via Deja.com http://www.deja.com/ Before you buy.Received on Tue Nov 14 2000 - 08:41:18 CST