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

Home -> Community -> Usenet -> c.d.o.server -> Re: Help With A Select

Re: Help With A Select

From: Steve Johnson <robertoc_at_fyiowa.infi.net>
Date: 1997/07/23
Message-ID: <33D6218D.4C09@fyiowa.infi.net>#1/1

Try:

SELECT a.route, a.available, a.capacity   FROM table_a a,

       (select route,min(available) available from temp group by route) b
 WHERE a.route = b.route
   AND a.available = b.available;

HornDog wrote:
>
> Given the following table
>
> table_a
>
> route available capacity
>
> 11 1200 3000
> 11 1400 2000
> 11 900 5000
>
> I need a query that will return a single row that has the minimum available
> value of the three rows and the corresponding capacity.
>
> I wrote the following query that returns '900', but how can I get the '5000'
> that goes along with it?
>
> SELECT route, MIN(available)
> FROM table_a
> WHERE route=11
> GROUP BY route;
>
> Any help would be appreciated ASAP!
>
> Brian
  Received on Wed Jul 23 1997 - 00:00:00 CDT

Original text of this message

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