如何用一个SQL语句查询多个表的记录数
转自:http://blog.csdn.net/keketrtr/article/details/5894067
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
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
- 上一篇: libcurl的使用 ftp篇(easy模式)
- 下一篇: SQL - SELECT COUNT用法