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

Home -> Community -> Usenet -> c.d.o.tools -> Selecting lowest foreign record for each primary key;

Selecting lowest foreign record for each primary key;

From: Matt Warner <matt.warner_at_didio.com.NOSPAM>
Date: Thu, 17 Aug 2000 15:17:59 +0100
Message-ID: <8ngs5n$dpl$1@newsreaderm1.core.theplanet.net>

Hi,

I have two tables which are linked by an intermediary table, e.g.

Cars = Car_Id, Car_Reg

Drivers = Driver_Id, Driver_Surname

Car_To_Driver = Join_Id, Car_Id, Driver_Id

Each car can have multiple drivers and each driver can have multiple cars.

How can I create a query that will return the Driver with the lowest Driver_Id for each Car?

In Access I used to use the First() function to acheive this.

Thanks,

Matt. Received on Thu Aug 17 2000 - 09:17:59 CDT

Original text of this message

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