mysql用一个select 如何一次性统计多张表的行数,分别列出来

我要查两张表各有多少行,我就要输入两个select: select count(*) from 表1; select count(*) from 表2; 怎么写,才能一个select,同时查询显示两张表的行数(注意是要分别列示) select '表1' as tablename,count(*) from 表1 union all select '表2' as tablename,coun
相关文章
相关标签/搜索