Skip to content

Instantly share code, notes, and snippets.

@karenpayneoregon
Created July 10, 2020 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karenpayneoregon/2711f4edeaa9f374f6cafef479d265fc to your computer and use it in GitHub Desktop.
Save karenpayneoregon/2711f4edeaa9f374f6cafef479d265fc to your computer and use it in GitHub Desktop.
Get order items by order id
DECLARE @OrderIdentifier INT= 10248;
SELECT p.ProductName,
od.ProductID,
od.UnitPrice,
od.Quantity,
od.Discount
FROM OrderDetails AS od
INNER JOIN Products AS p ON od.ProductID = p.ProductID
WHERE od.OrderID = @OrderIdentifier;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment