SQL SQL statement for inserting multiple data
There are three ways to do this:
1.InSert into < table name > (column name)
Select < column name >
From < source table name >
Example: INSERT into Tongxunlu (name, phone, email)
SELECT Sname,saddress,semail
From Students This method requires a new table to be built first.
2.Select (column name)
into < table name >
From < source table name >
Example: SELECT students.sname,students.saddress,students.semail
Into Tongxunlu
From Students this method SQL auto-Build table
3.InSert into < table name > (column name)
Select < column name > Union
Select < column name > Union
......
Example: INSERT STUDENTS (Sname,sgrade,ssex)
SELECT ' Xiaomin ', 7,1 UNION
SELECT ' xiaoming ', 4,0 UNION
SELECT ' Piglet ', 2,0 UNION
SELECT ' Jokes ', 3,0 UNION
SELECT ' size ', 7,1 UNION
SELECT ' no two ', 3,1 UNION
SELECT ' Little Wei ', 7,1 UNION
SELECT ' small just ', 4,1 UNION
SELECT ' Xiao Juan ', 7,0