0
I have the following hypothetical consultation with the bank:
SELECT dinheiro_na_carteira,
(SELECT sum(despesas_pagas_carteira) FROM DESPESAS WHERE id = X ) as despesas
FROM RECEITAS
WHERE dinheiro_na_carteira - despesas > 0
When trying to make this query it returns the following error:
[Err] 42S22 - [SQL Server]Invalid column name
Can anyone give me a suggestion how I can resolve this situation? I don’t even know what to look for to resolve.
I understood your solution. thank you!
– David Vinicius
@Davidvinicius I learned about that
subQuery
here: SQL: Table Transformation.– Marconi