Home » RDBMS Server » Server Administration » QUERY..help..:o)
QUERY..help..:o) [message #371392] Thu, 12 October 2000 09:42 Go to next message
zizou
Messages: 1
Registered: October 2000
Junior Member
i have 3 tables
frequentation (dancer, club)
where the dancer x goes to the club y

liking(dancer, music)
where the dancer x likes the kind of music z

playing (club, music)
where the club y plays the kind of music z

i want a query that list all the dancers, in a way that any club where x goes to plays at least one kind of music that x likes

and also this other query
the list of dancers, in a way that not one of the clubs where x goes to, plays a type of music that he likes

thanks..:)))
Re: QUERY..help..:o) [message #371397 is a reply to message #371392] Fri, 13 October 2000 06:03 Go to previous message
Prem
Messages: 79
Registered: August 1998
Member
Zizou,

For ur first query,

SELECT distinct f.dancer from f, l, p where f.dancer = l.dancer and
f.club = p.club and l.music = p.music

For the 2nd query
select distinct dancer from f where dancer not in (
SELECT f.dancer from f, l, p where f.dancer = l.dancer and
f.club = p.club and l.music = p.music)

I have used the alias as follows

f - frequentation
l - liking
p - playing

hth

Prem :)
Previous Topic: registering software in Solaris Qualix Cluster
Next Topic: replace please help
Goto Forum:
  


Current Time: Thu Apr 18 13:01:13 CDT 2024