Mysql uses union all query to count the total quantity
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 (note that individual names should be given here)
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 (note that individual names should be given here)