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

Home -> Community -> Usenet -> comp.databases.theory -> Re: How would Homer write an SQL query?

Re: How would Homer write an SQL query?

From: Scott.David.Daniels <Scott.Daniels_at_Acm.Org>
Date: 2000/03/13
Message-ID: <38CC4BAD.EC468A3C@Acm.Org>#1/1

> _The Odyssey_ begins with an invocation to the Muse Calliope:
>
> "Tell me, O Muse, of that ingenious hero who travelled far and wide after he
> had sacked the famous town of Troy."

SELECT p.*

FROM	Muse..Person p,
	Muse..battle b
WHERE
	b.target = "Troy"
AND	b.victor = p.id
AND	EXISTS (SELECT * 
	 FROM	Muse..TripParts leg 
	 WHERE	leg.traveller = p.id
	 AND	leg.distance >= FAR
	 AND	leg.when >= b.when)
AND	EXISTS (SELECT trip_id 
	 FROM	Muse..TripParts leg 
	 WHERE	leg.traveller = p.id
	 AND	leg.when >= b.when
	 GROUP BY leg.trip_id
	 HAVING SUM(leg.distance) >= WIDE)


-Scott David Daniels
scott.daniels_at_Acm.Org Received on Mon Mar 13 2000 - 00:00:00 CST

Original text of this message

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