SQL introductory learning record-01-new table record

SQL script written insert
INSERT INTO userinfo1 (the userid, username, In Email)
value ( '', '', '')

Translation: Go to the userinfo1 table, select the desired column name, and fill in the desired value in value, corresponding to the column name above
Insert picture description here
2. Get data from another database and insert it into the current database

insert into userinfo1(userid, username, email)
select userid,username,email from [dbo].[userinfo]
Translation: It means to find the userid, username, email in [dbo].[userinfo] database, and then put them Insert the (userid, username, email) below into the userinfo1 database, which is to take the 123 attribute of other databases and insert it into the corresponding 123 attribute of the database you want to insert
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_48116269/article/details/115377010