MySQL direct INSERT INTO with WHERE clause

前端 未结 6 2070
梦如初夏
梦如初夏 2020-12-15 09:04

I tried googling for this issue but only find how to do it using two tables, as follows,

INSERT INTO tbl_member
SELECT Field1,Field2,Field3,... 
FROM temp_ta         


        
6条回答
  •  醉酒成梦
    2020-12-15 09:31

    The INSERT INTO Statement
    The INSERT INTO statement is used to insert a new row in a table.
    SQL INSERT INTO Syntax

    It is possible to write the INSERT INTO statement in two forms.

    The first form doesn't specify the column names where the data will be inserted, only their values:

    INSERT INTO table_name
    VALUES (value1, value2, value3,...)
    

    The second form specifies both the column names and the values to be inserted:

    INSERT INTO table_name (column1, column2, column3,...)
    VALUES (value1, value2, value3,...)
    

提交回复
热议问题