当前位置:Gxlcms > 数据库问题 > mysql一条sql查询多个表数据量

mysql一条sql查询多个表数据量

时间:2021-07-01 10:21:17 帮助过:108人阅读

select
(select count(*) from device0 where status != 0),
(select count(*) from device1 where status != 0),
(select count(*) from device2 where status != 0),
(select count(*) from device3 where status != 0),
(select count(*) from device4 where status != 0),
(select count(*) from device5 where status != 0),
(select count(*) from device6 where status != 0),
(select count(*) from device7 where status != 0),
(select count(*) from device8 where status != 0),
(select count(*) from device9 where status != 0)
as count

 

 

select
(select count(*) from device0 where status != 0)+
(select count(*) from device1 where status != 0)+
(select count(*) from device2 where status != 0)+
(select count(*) from device3 where status != 0)+
(select count(*) from device4 where status != 0)+
(select count(*) from device5 where status != 0)+
(select count(*) from device6 where status != 0)+
(select count(*) from device7 where status != 0)+
(select count(*) from device8 where status != 0)+
(select count(*) from device9 where status != 0)
as count

mysql一条sql查询多个表数据量

标签:dev   sql   rom   表数据   查询   数据   from   where   device   

人气教程排行