locked
Insert into new table RRS feed

  • Question

  • User1979860870 posted

    Hi

      I have below query and want to save results in New Table

    Select Code ,name ,Quantity,Value from Tbl1

    union all

    select Code,Name,Quantity,Value from tbl2

    Thanks

    Tuesday, November 10, 2020 1:46 PM

Answers

  • User452040443 posted

    Hi,

    Try:

    with CTE_Union as
    (
      Select Code ,name ,Quantity,Value from Tbl1
    
      union all
    
      select Code,Name,Quantity,Value from tbl2
    )
    
    select * into TblNew from CTE_Union

    Hope this help

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 10, 2020 2:08 PM