|
Posted by ZeldorBlat on 09/27/23 11:40
laredotornado@zipmail.com wrote:
> Hello,
>
> I have a table with vacation offier_id's and prices
>
> OFFER_ID PRICE
> --------------- --------
> 1 50.00
> 2 75.00
> 1 85.00
> 1 45.00
> 2 200.00
>
> I want to write a query to return the offer_id with its lowest price.
> The result of scanning the above data would be
>
> OFFER_ID PRICE
> --------------- ---------
> 1 45.00
> 2 75.00
>
> Using MySQL 4, is there any way to write a single query to do this?
> I'm using PHP 4 also.
>
> Thanks, - Dave
select OFFER_ID, min(PRICE)
from VACATIONS
group by OFFER_ID
from
Navigation:
[Reply to this message]
|