作业帮 > 综合 > 作业

select count(*) from table1 select count(*) from table2 sele

来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/07/31 05:19:11
select count(*) from table1 select count(*) from table2 select count(*) from table3
我从table1 table2 table3 中 找数据的条数
怎样一下子用一条sql语句 算出TABLE1 TABLE2 TABLE3 记录的总和?
select count(*) from table1 select count(*) from table2 sele
select sum(c) from (
select count(*) c from table1
UNION select count(*) c from table2
UNION select count(*) c from table3
) t
使用UNION将三条查询的结果合并,再外套一层求和.