Re: Select f1, min(f2) ????

From: <seci_at_ludens.elte.hu>
Date: 1996/05/20
Message-ID: <1996May20.075705.29421_at_ludens>#1/1


Hello,

In article <4n6hd2$eev_at_castle.nando.net>, blais_at_nando.net (Al Blais) writes:

> In article <APC&63'0'150a5a49'c02_at_glas.apc.org>, kivi_at_glas.apc.org says...

>>
>>Hello All
>>
>>Could someone point out if there a way
>>of selecting two fields from the table when one
>>field reaches for example its minimum.
>>
>>I don't like the following because I think
>>that it may be done more efficiently, because
>>f1 is found at the time of subquery.
>>
>>select f1, f2 from t1 where f2=min( select f2 from t1
>> where (<<criteria>>));
>>
>>For simplicity lets assume that all f2 are different.
>>
>>
>>Konstanti
> 
> 
> I'm not really sure about the problem you are having (sub-query ????)
> 
> Select f1, MIN(f2) from t1
> Where  a=b
> group by f1
> having min(f2) > 8       <--- this is really optional or maybe a parameter

Never use this because group by always makes a FULL TABLE SCAN !!! Use the subquery or pl/sql advised in a previous article.

> 
> Al 
> blais_at_nando.net
> 

	seci
Received on Mon May 20 1996 - 00:00:00 CEST

Original text of this message