Insert into … values ( SELECT … FROM … )

前端 未结 26 2484
我在风中等你
我在风中等你 2020-11-21 05:40

I am trying to INSERT INTO a table using the input from another table. Although this is entirely feasible for many database engines, I always seem to struggle t

26条回答
  •  忘了有多久
    2020-11-21 05:59

    Best way to insert multiple records from any other tables.

    INSERT  INTO dbo.Users
                ( UserID ,
                  Full_Name ,
                  Login_Name ,
                  Password
                )
                SELECT  UserID ,
                        Full_Name ,
                        Login_Name ,
                        Password
                FROM    Users_Table
                (INNER JOIN / LEFT JOIN ...)
                (WHERE CONDITION...)
                (OTHER CLAUSE)
    

提交回复
热议问题