Oto jeden sposób:
select (select count(*) from table1) as t1_amount,
(select count(*) from table2) as t2_amount
Oto inny sposób:
select t1.t1_amount, t2.t2_amount
from (select count(*) as t1_amount from table1) t1 cross join
(select count(*) as t2_amount from table2) t2
Twoja metoda nie działa, ponieważ ,
w from
klauzula wykonuje cross join
. To tworzy iloczyn kartezjański między dwoma stołami.