建立2個結構相同的表,並從乙個往另乙個拷貝記錄

2021-06-20 02:45:19 字數 642 閱讀 6734

該功能可以用於把本地access資料庫中的表,轉化成網上mysql中的表

create table xigongda_chengji like xigongda_tieyi;

拷貝記錄

insert into xigongda_chengji(stu_name,xiaoxue,parent_name,tel,pass_word,the_five,shijian) select stu_name,xiaoxue,parent_name,tel,pass_word,the_five,shijian from xigongda_tieyi where id<20;

insert into table60(col2,col3,col4) select col2,col3,col4 from table58 where col1>3 and col1<6;

table58可以是從本地新上傳的資料量比較少的臨時表,而table60是真正的用jsp讀取的表,該錶資料量大,不易頻繁從本地上傳。

這樣,在給伺服器上的用phpmyadmin管理mysql錄入資料時,就可以用本地access當客戶端了。在網頁上直接錄入資料太慢。

可以把access導成csv,然後把csv再匯入伺服器上的mysql

根據乙個已存在的表,去建立乙個相同的表

利用已存在的customer表來建立 customer2表 oracle create table customer2 as select from customer mssql select into customer3 from customer 本人親測可以用 mysql 同oracle cr...

從乙個表複製到另乙個表

insert into select語句 語句形式為 insert into table2 field1,field2,select value1,value2,from table1 要求目標表table2必須存在,由於目標表table2已經存在,所以我們除了插入源表table1的字段外,還可以插...

SQL 將兩個結構相同的表合併到成乙個表

select into 新錶名 from select from t1 union all select from t2 這個語句可以實現將合併的資料追加到乙個新錶中。不合併重複資料 select from t1 union all select from t2 合併重複資料 select from...