如何用一个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
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
- 上一篇: 一条sql语句分别统计出来两张表的数据
- 下一篇: Golang类型转换