field of the score table: Xueshenghao,yu,shu,yy are of type int. The new standard is the same as the Score table field, and the difference is that there is data in the score tables, but not in the new table (it is an empty table and none of the data). Requirements: Add the Yu,shu scores of each person in the score table to the new table. Database version mysql5.5.38.
CREATE TABLE ' Chengjibiao ' (
' Xueshenghao ' int (255) not NULL auto_increment,
' Yu ' int (255) DEFAULT NULL,
' Shu ' int (255) is DEFAULT NULL,
' yy ' int (255) DEFAULT NULL,
PRIMARY KEY (' Xueshenghao ')
) Engine=myisam DEFAULT CHARSET=GBK This is the table of achievement statement
This is the score table.
CREATE TABLE ' Newbiao ' (
' Xueshenghao ' int (255) not NULL auto_increment,
' Yu ' int (255) DEFAULT NULL,
' Shu ' int (255) is DEFAULT NULL,
' yy ' int (255) DEFAULT NULL,
PRIMARY KEY (' Xueshenghao ')
) Engine=myisam DEFAULT CHARSET=GBK This is the table statement for the new table
Implementation code: Insert Newbiao (Yu,shu) select Yu,shu from Chengjibiao;
Add one or more columns from one table in a database to a column in another table--Hunt starling fly