I have two tables: pessoas
and carros
.
I would like to take the number of elements of both tables, and multiply them.
I have two tables: pessoas
and carros
.
I would like to take the number of elements of both tables, and multiply them.
I think this is what you want:
SELECT a.c * b.d AS produto
FROM (SELECT COUNT(*) AS c FROM pessoas) a,
(SELECT COUNT(*) AS d FROM carros) b
select
(select count(*) from pessoas) *
(select count(*) from carros)