如何用一个SQL语句查询多个表的记录数
sql语句如下:
select t1.num1,t2.num2 from
(select count(*) num1 from table1) t1,
(select count(*) num2 from table2) t2
如果要显示这两张表中记录数的总和就是
select t1.num1,+t2.num2 from
(select count(*) num1 from table1) t1,
(select count(*) num2 from table2) t2
声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
- 上一篇:没有了
- 下一篇: mysql开启binlog日志后重启失败
