超酷小 发表于 2018-9-29 07:25:03

mysql使用 union all查询统计总数量

  select sum(a.b) as num from (
  select count() as b from table_1
  union all
  select count() as b from table_2
  ) as a(注意这里要取个别名)

页: [1]
查看完整版本: mysql使用 union all查询统计总数量