sql復(fù)制一個(gè)一模一樣的表 SQL語句,怎么把一個(gè)表的數(shù)據(jù)復(fù)制到另外一個(gè)表里面?
SQL語句,怎么把一個(gè)表的數(shù)據(jù)復(fù)制到另外一個(gè)表里面?1. 將舊表的數(shù)據(jù)復(fù)制到新表中(假設(shè)兩個(gè)表的結(jié)構(gòu)相同)insert into new table select*from the old table
SQL語句,怎么把一個(gè)表的數(shù)據(jù)復(fù)制到另外一個(gè)表里面?
1. 將舊表的數(shù)據(jù)復(fù)制到新表中(假設(shè)兩個(gè)表的結(jié)構(gòu)相同)insert into new table select*from the old table
2。將舊表的數(shù)據(jù)復(fù)制到新表(假設(shè)兩個(gè)表的結(jié)構(gòu)不同)插入新表(字段1,字段2,…)選擇字段1,字段2,。。。。。。從舊桌子上取下來
3。將表結(jié)構(gòu)和數(shù)據(jù)復(fù)制到新表select*into target table name from Source table name(目標(biāo)表不存在,因?yàn)椴迦霑r(shí)會(huì)自動(dòng)創(chuàng)建)
如何用一條SQL語句搞定從一張表復(fù)制記錄到另一張表?
當(dāng)表結(jié)構(gòu)相同時(shí),直接插入表a從不同的表B中選擇*。插入表a(字段a、B、c)選擇字段D、e、F從表a不存在時(shí)的表b