-
-
Save parzibyte/31bc664733840cad4df94b8762cb1885 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 menos 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) asc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment