数据库中有一个表,很大。所以必须要 拆分了。才能导出,导入之后呢,又要合并。因不想用insert之类的语句,特来请教高人如 表1 字段1
a
b
c
d拆分成表2字段1
a
表3字段1
b表4字段1
c
表5字段1
d
完了之后呢,又合并表2到表5合并成 表1的样子。

解决方案 »

  1.   

    没什么好办法。只能用 insertcreate table 表2 as select * from 表1 where 字段1='a';
    create table 表3 as select * from 表1 where 字段1='b';
    create table 表4 as select * from 表1 where 字段1='c';
    create table 表5 as select * from 表1 where 字段1='d';合并
    create table 表1 as select * from (
    select * from 表2
    union all
    select * from 表3
    union all
    select * from 表4
    union all
    select * from 表5
    ) t