-
-
Save parzibyte/870dbf5679d2adaee439c435ad7b749a 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
/*Listado de productos por no de ventas ordenando de mayor a menor*/ | |
select pp.ProductID, pp.Name,pp.ProductNumber, pp.ListPrice, | |
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,pp.ProductNumber, pp.ListPrice | |
order by count(ss.ProductID) desc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment