Is it possible to pull counts from two tables that are not joined?
For example:
SELECT
(SELECT COUNT(PERSON) FROM PEOPLE),
COUNT(BUILDINGS)
FROM
BUILDINGS
I get an error saying:
not a single-group group function.
One way to do it is by moving both count queries in the select
clause:
select
(SELECT COUNT(*) FROM PEOPLE) people_cnt,
(SELECT COUNT(*) FROM BUILDINGS) building_cnt
from dual