drop table test

 

 

(price),
maxsaller=(select top 1 seller from sale where productid=p.productid order by price desc),
minsaller
=(select top 1 seller from sale where productid=p.productid) 
from sale s inner join product p on p.productid=s.productid
group by  p.productid,p.productname

相关文章: