Joining the queries together

  • If you want these queries to be columns of a result set then you will have to use the cross apply join. You can save the results into a temp or table variable then use the cross apply. I have provided an example below.

    select 1 [1],2 [2],3 [3] into #temp

    select 4 [4],5 [5],6 [6] into #temp2

    select 5 [5],6 [6],7 [7] into #temp3

    select *

    from #temp a

    cross apply

    (select * from #temp2) as b

    cross apply

    (select * from #temp3)as c

    drop table #temp

    drop table #temp2

    drop table #temp3

Viewing post 1 (of 2 total)

You must be logged in to reply to this topic. Login to reply