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

Home -> Community -> Usenet -> c.d.o.misc -> Re: A tricky query question...

Re: A tricky query question...

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Thu, 2 Dec 1999 07:28:31 -0000
Message-ID: <944120186.989.0.nnrp-08.9e984b29@news.demon.co.uk>

select resort
from resort_sports
group by resort
having count(*) =

    (select count(*) from sports)
;

Assumes the the PK on report_sports is (resort, sport) and the PK on sports is (sport)

--

Jonathan Lewis
Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk

jk_man_at_my-deja.com wrote in message <823sgg$q9s$1_at_nnrp1.deja.com>...
>I'm doing this college assignment and I just can't solve this query - it
>seems straigth forward at first, but it isn't.
>
>OK...
>
>I'm given a table of sports activites (call this sports) and another
>table of holiday resorts (call this resorts) where each resort has
>numerous sports facilities. i.e. each resort has several rows, each one
>describing a different sports facility.
>
>Now the query is:
>
>Select all those resorts that have facilities for *all* sports
>activities (as listed in sports) and ignore the other resorts. I think
>I'm supposed to use 'MINUS', but there may be other ways also.
Received on Thu Dec 02 1999 - 01:28:31 CST

Original text of this message

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