I´m getting this error
1241 - Operand should contain 1 column(s)
when I try to select these two tables and columns.
I tried to remove the () from the select but that didn't work.
SELECT (SELECT (SUM(preco_base),0) FROM produtos) +
(SELECT (SUM(salario_base),0) FROM salarios)
FROM DUAL;
sum() contanin a single operand sum(acol) not sum(col, 0)
You could try using a croos join
select a.sum_preco_base + b.sum_salario_base
from (
SELECT SUM(preco_base) sum_preco_base
FROM produtos
) a
CROSS JOIN (
SELECT (SUM(salario_base) sum_salario_base
FROM salarios
) b
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments