You mean the where filters on the orders? Sorry I glanced over including them during my testing to make sure it would return results. The correct code would be :
Code:
Select a.OrderNumber, a.OrderDate, a.OrderTotal, 'Not Shipped' AS NotShipped,
Left(a.Ordersku,Len(a.Ordersku)-1) As "Order SKUs"
From(Select distinct o.OrderNumber, o.OrderDate, o.OrderTotal,
(Select osc.OrderedProductSKU + ',' AS [text()]
From dbo.Orders_ShoppingCart osc
Where osc.OrderNumber = o.OrderNumber
For XML PATH ('')) [Ordersku]
From dbo.Orders o WHERE o.TransactionState = 'AUTHORIZED' AND o.ShippedOn IS NULL AND o.IsNew = 0 AND o.OrderNumber > 110000 ) [a]
It does have a join just due inner SQL statements it harder to read. This code may be a bit easier to read and does the same thing with an extra join. It also makes it a bit easier to add a column from the orders table.
Code:
Select o.OrderNumber, o.OrderDate, o.OrderTotal, 'Not Shipped' AS NotShipped,
Left(a.Ordersku,Len(a.Ordersku)-1) As "Order SKUs"
from dbo.Orders o with (NOLOCK)
join (Select distinct o.OrderNumber,
(Select osc.OrderedProductSKU + ',' AS [text()]
From dbo.Orders_ShoppingCart osc
For XML PATH ('')) [Ordersku]
From dbo.Orders o) [a] ON a.OrderNumber = o.OrderNumber
WHERE o.TransactionState = 'AUTHORIZED' AND o.ShippedOn IS NULL AND o.IsNew = 0 AND o.OrderNumber > 110000