MySql计算多个表的数据总行数

SELECT
	sum( t.count ) as sum
FROM
	( SELECT count(*) AS 'count' FROM eswa_warning_type 
		UNION ALL 
		SELECT count(*) AS 'count' FROM eswa_warning_template ) t

你可能感兴趣的:(mysql,数据库)