select vend_id,prod_price as cheapest_item from (select vend_id,prod_price,rank() over (partition by vend_id order by prod_price)as ranking from Products )as B where B.ranking=1 order by prod_price asc 使用窗口函数更容易理解,先内部排序,取最小的价格,再对取出来的数值进行排序先对每一个产品的标价进行升序排序,取每一个产品的第一个价格,即为最低价