GOAL
Eu tenho duas tabelas (tb_get_gap, tb_getCountSRVS), onde na primeira tabela conto para obter os valores desejados e na segunda tenho valores inteiros, só quero pegar o valores das duas e subtrair
QUERY
select
(cast(srvs as int) - (SELECT COUNT(*) hostname FROM tb_get_gap
LEFT JOIN tb_get_customers
ON tb_get_gap.customer = tb_get_customers.cust_cmdb WHERE tb_get_customers.customer in (select customer from tb_get_customers) and tb_get_gap.exception = 'NO'
GROUP BY tb_get_gap.customer ORDER BY tb_get_gap.customer ASC))
from tb_getCountSRVS order by cust_code asc
OUTPUT
>[Error] Script lines: 1-6 --------------------------
ERROR: more than one row returned by a subquery used as an expression
Line: 1