;with DayWHAS (select 20 as Days_in_warehouse union all select 30 union all select 40),Table1 AS (select 1 as [PO#] ,10 Days_to_travel,20 Days_in_warehouse union all select 2,5,30 union all select 3, 7, 40)SELECT [PO#] ,Days_to_travel ,B.Days_in_warehouse ,A.Days_in_warehouseFROM DayWH A CROSS JOIN Table1 BORDER BY [PO#]
outputPO# Days_to_travel Days_in_warehouse Days_in_warehouse1 10 20 201 10 20 301 10 20 402 5 30 202 5 30 302 5 30 403 7 40 203 7 40 303 7 40 40
sabinWeb MCP