千家信息网

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

发表于:2024-09-22 作者:千家信息网编辑
千家信息网最后更新 2024年09月22日,select sum(a.b) as num from (select count() as b from table_1union allselect count() as b from table
千家信息网最后更新 2024年09月22日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(注意这里要取个别名)

0