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

小编:优质农业网   人气:0℃   发布时间:2025-02-20 23:43:09
字号:

select f_name,t.maxPrice from fruits,(

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

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

运行结果;

版权声明:本站文章来源互联网,如有侵犯您的权益,请及时联系我们处理;

原文链接:https://baike.tt44.com/news/1_854354.html