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: table join problem

Re: table join problem

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Fri, 09 Jan 2004 09:08:19 -0800
Message-ID: <1073668017.378941@yasure>


Perica Milosevic wrote:

> Hello!
>
> I have master-detail relationship between two tables, for example:
> Company (companyid, companyname), Worker(companyid, workerid,
> workername, workerage) where the 'companyid' field is connection
> between this two tables.
>
> I want to select ALL workers from all companies that employ workers
> older than 60 (workerage > 60).
>
> For example:
> COMPANY
> companyid 1, companyname ORACLE
> companyid 2, companyname SUN
> companyid 3, companyname IBM
>
> WORKER
> companyid 1, workerid 1, workername 'John', workerage 32
> companyid 1, workerid 2, workername 'Smith', workerage 61
> companyid 2, workerid 1, workername 'Peter', workerage 27
> companyid 2, workerid 2, workername 'Jenet', workerage 33
> companyid 2, workerid 3, workername 'Michael', workerage 38
> companyid 3, workerid 1, workername 'Sarah', workerage 41
> companyid 3, workerid 2, workername 'Nick', workerage 63
>
> I would like to get:
> 1, 1, 'John', 32
> 1, 2, 'Smith', 61
> 3, 1, 'Sarah', 41
> 3, 2, 'Nick', 63
>
> Thanks in advance,
> Perica Milosevic

Since this is school work ... post your best attempt to solve it and we will give you hints.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Fri Jan 09 2004 - 11:08:19 CST

Original text of this message

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