MySQL查询fruits表中不同s_id下价格最高的水果名称以及这些水果的价格?

2023-08-24 23:30:17 来源:网友发布 作者:网友发布

select f_name,t.maxPrice from fruits,(

select s_id,max(f_price) as maxPrice from fruits group by s_id) t?

where fruits.s_id=t.s_id and fruits.f_price=t.maxPrice

运行结果;

同类最新

(c)2008-2023  Www.QNWTOP.Com All Rights Reserved