年前事情比较多,博客不能每天更新了. 1.union all 纵向建表和left join 横向建表的数据结构区别 先贴代码 后面再补充 (#销售确认额 SELECT '05收货销售额' AS 标识,城市,餐馆ID,销售员,订单号 AS 订单ID,订单日期 AS 订单时间,SKUID,NULL AS 相应ID,NULL AS 相应名称,类型,单位,销量 AS 数量,'A收货确认额' AS 类型1,成本额 AS 相应成本,销售额 AS 金额,毛利额 AS 毛利,应收日 AS 收货时间 FROM `…