標題:

關於 MYSQL COPY TABLE Command

發問:

關於 MYSQL COPY TABLE Command 怎樣把 MYSQL 資料庫ABC的 TABLE:ONE, TABLE:TWO, TABLE:THREE, COPY TO 資料庫ABC的 TABLE:TOTAL. thank a lot easy9756 更新: e.g. TABLE ONE COST CENTER C1 TABLE TWO COST CENTER C2 TABLE THREE COST CENTER C3 更新 2: e.g. TABLE ONE STRUCTURE COST CENTRE,ID,NAME. TABLE ONE RECORD C1, C1001, AAA C1, C1002, BBB TABLE TWO STRUCTURE COST CENTRE,ID,NAME. TABLE TWO RECORD C2, C2001, CCC C2, C2002, DDD TABLE THREE STRUCTURE COST CENTRE,ID,NAME. TABLE THREE RECORD C3, C3001, EEE C3, C3002, FFF

最佳解答:

if "TOTAL" is a existing table and u want to insert all records from tables "ONE", "TWO", "THREE". ?u can use following SQL. INSERT into total (?cost_centre, id, name ) SELECT cost_centre, id, name FROM one? UNION ALL SELECT cost_centre, id, name FROM two? UNION ALL? SELECT cost_centre, id, name FROM three. If "TOTAL" isn't a existing table and u need to create it and?to insert all records from tables "ONE", "TWO", "THREE". ?u can use following SQL. CREATE TABLE total AS SELECT cost_centre, id, name FROM one? UNION ALL SELECT cost_centre, id, name FROM two UNION ALL? SELECT cost_centre, id, name FROM three.

免費註冊體驗

 

此文章來自奇摩知識+如有不便請留言告知

其他解答:
arrow
arrow
    文章標籤
    e.g. 文章 左未 奇摩
    全站熱搜
    創作者介紹
    創作者 ppi93gk88d 的頭像
    ppi93gk88d

    ppi93gk88d的部落格

    ppi93gk88d 發表在 痞客邦 留言(0) 人氣()