葫芦金刚

导航

MySQl 合并结构相同的多张表

CREATE TABLE goods_xinxi
        select * from goods_xinxi_0
        UNION ALL
        select * from goods_xinxi_1
        UNION ALL
        select * from goods_xinxi_2
        UNION ALL
        select * from goods_xinxi_3
        UNION ALL
        select * from goods_xinxi_4
        UNION ALL
        select * from goods_xinxi_5

  后续还可以加入多个表,示例只合并6张表

  合并需要用到的函数有 UNION ALL 和 UNION ,不同之处网上有很多介绍。

  

posted on 2019-05-21 09:59  葫芦金刚  阅读(1556)  评论(0编辑  收藏  举报