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: how to do this "simple yet hard" query in Oracle9

Re: how to do this "simple yet hard" query in Oracle9

From: Daniel A. Morgan <damorgan_at_exesolutions.com>
Date: Sat, 20 Apr 2002 23:38:53 +0100
Message-ID: <3CC1EDFD.FE47FDEF@exesolutions.com>


My impression is that this is a school project so I am going to give you the level of advice appropriate to you learning to do this yourself.

First write a select statement like this:

SELECT DISTINCT author, publisher
FROM your three tables
WHERE link your tables

Then use this SQL statement as an in-line view looking for any author whose in the in-line view only once.

Daniel Morgan

teri wrote:

> I know it's probably very easy once you've done similar queries
> before, but I'm no pro at this so have me excused...
>
> I have three tables: a author, b book and c publisher.
> An author can write many books, each book may have a different
> publisher, you get the idea:
>
> a author (a-key)
> b book (b-key c-key)
> c publisher (c-key)
>
> I want to submit a query that will get only the authors that have
> written all their books for the same publisher.
> Only those instances of a that may be assosciated with different
> instances of b but just one c (there is no direct key between a and c
> of course)?
>
> I'd be grateful if anyone has an answer.
>
> (If this message didn't fit into the subject of group I apologize)
Received on Sat Apr 20 2002 - 17:38:53 CDT

Original text of this message

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