我如何count(*)从两个不同的表中进行选择(调用它们tab1和tab2),结果是:
count(*)
tab1
tab2
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