如何从两个不同的表(称为 tab1
和 tab2
)中选择 count(*)
结果:
How can I select count(*)
from two different tables (call them tab1
and tab2
) having as result:
Count_1 Count_2
123 456
我已经试过了:
select count(*) Count_1 from schema.tab1 union all select count(*) Count_2 from schema.tab2
但我只有:
Count_1
123
456
SELECT (
SELECT COUNT(*)
FROM tab1
) AS count1,
(
SELECT COUNT(*)
FROM tab2
) AS count2
FROM dual
这篇关于从多个表中选择count(*)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!