WITH deliveryOrderQuery

AS ( SELECT {0}

ROW_NUMBER() OVER ( ORDER BY (SELECT 0)) AS rownum ,

D.DeliveryOrder_ID,

D.SAP_DeliveryOrder_ID,

D.TypeCode,

D.Customer_ID,

D.SAP_RequiredDate,

D.SONumber,

D.CustomerPO,

D.ShipTo,

D.ProgressCode,

D.QueueSequence

FROM DeliveryOrder AS D

{1}

)

SELECT

ORDER BY (SELECT 0)