I wrote a small SQL Query in SQL Server 2005 to return Customer Order Number, Email and their order details.
The query works but it returns the email address and order id multiple times as each customer can have more than one item in their order.
I am posting my Query. anyway to modify it so that only once the order number and email is returned even if the customer has more than one item
I think I am missing something very simple here.
SELECT [Order].Id, [Order].Email, [Order].PromotionCode, [Order].ShippingCost, OrderItem.ItemNumber, Size.Name, OrderItem.Price, Size.Id AS Expr1
FROM [Order] INNER JOIN OrderItem ON [Order].Id = OrderItem.OrderId
INNER JOIN Size ON OrderItem.SizeId = Size.Id
WHERE ([Order].PromotionCode = 'M123') OR ([Order].PromotionCode = 'T4444') OR ([Order].PromotionCode = 'WABD') OR ([Order].PromotionCode = 'Q695') OR ([Order].PromotionCode = 'P675')
Thanks and appreciate it