Bumped into a query I'm not sure how to write.
I have the following SP:
SELECT i.ItemID, i.ItemDescription, i.InventoryNo, i.SerialNo, i.Location, i.Disposals, i.UnitCost, i.VAT, i.Total, o.InvoiceNo, o.OrderDate, s.SupplierName
FROM Orders o
ON o.OrderID = i.OrderID
ON o.SupplierID = s.SupplierID
Where i.nominal = @nominal
I want to pull in a new column from a third table (ItemType - holding CategoryID & Category) - I want Category.
The Join would be between OrderItems.ItemType and ItemType.CategoryID.
How would I write this given that my primary table is Orders?