您的位置:首页 > 数据库

如何用一个SQL语句查询多个表的记录数

2010-09-19 11:23 567 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐