Last active
July 11, 2020 12:10
-
-
Save karenpayneoregon/18df5808020872215895192c50fcd482 to your computer and use it in GitHub Desktop.
Get products by category for NorthWind2020
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
DECLARE @CategoryID INT= 2; | |
SELECT P.ProductID, | |
P.ProductName, | |
P.UnitPrice, | |
P.UnitsInStock, | |
P.SupplierID, | |
S.CompanyName AS SupplierName, | |
C.[Name] AS SupplierCountry | |
FROM Products AS P | |
INNER JOIN Suppliers AS S ON P.SupplierID = S.SupplierID | |
INNER JOIN Countries AS C ON S.CountryIdentifier = C.CountryIdentifier | |
WHERE P.CategoryID = @CategoryID; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment