Avatar of directxBOB
Flag for Ireland

asked on 

Help with a left join

I have two tables


I am trying to do a join on these two tables where i display all the products from the Products Table but I do a join where I use the OrderID to find the OrderItems, and then display the Quantity from this this table.

This is what I have:

SELECT Products.ProductId, Products.ProductDescription, OrderItems.Quantity
FROM tProducts
LEFT JOIN OrderItems
ON tProducts.ProductId=OrderItems.ProductId where OrderItems.orderID = '1123'

Which does return

ProductID, ProductDescription, Quantity

but it is currently only showing the 1 single OrderItem which has '1123'

Instead of all Products and the Quantity for the orderitem with orderid 1123.

Avatar of undefined
Last Comment

8/22/2022 - Mon