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: Urgent help on SQL

Re: Urgent help on SQL

From: Jayadas C <jayadasc_at_emirates.com>
Date: 1997/07/26
Message-ID: <01bc996d$0fd91060$237daac2@eucit>#1/1

try this ...

select	a.route, a.available, a.capacity
from	table_a a
where	a.route = 11
and       rownum < 1
and	a.available = (	select 	min(b.available)
			from	table_a b
			where	b.route = a.route
			group	by b.route
		        );

hope this solves your problem ... pls reply

regards,
jayadas

> > >>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".
> > >>
Received on Sat Jul 26 1997 - 00:00:00 CDT

Original text of this message

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