-
-
Save parzibyte/9e9fc3cd19d76642cc968f5889108f0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*El producto más vendido*/ | |
select top 1 pp.ProductID, pp.Name, count(ss.ProductID) as veces_vendido | |
from Production.Product pp | |
inner join Sales.SalesOrderDetail ss | |
on pp.ProductID = ss.ProductID | |
group by ss.ProductID, pp.Name, pp.ProductID | |
order by count(ss.ProductID) desc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment