我有两个表,我计算它们的行数.例如;
Select count(*) FROM tbl_Events
Select count(*) FROM tbl_Events2
Run Code Online (Sandbox Code Playgroud)
我需要总数.如何用单个语句对结果求和?
Mar*_*c B 19
select sum(cnt) from (
select count(*) as cnt from tbl_events
union all
select count(*) as cnt from tbl_events2
) as x
Run Code Online (Sandbox Code Playgroud)