0
Hello. I am having problems with my query at ORACLE, someone would tell me how to solve it ?
SELECT C.NRO_CONTA, C.NOME, C.SALDO, SUM(RESULTADO.COTAS) FROM CONTA C
JOIN FUNDOS_APLIC AS RESULTADO
ON RESULTADO = ( SELECT SUM(FAP.NRO_COTAS) AS COTAS FROM FUNDOS_APLIC FAP WHERE FAP.NRO_CONTA = C.NRO_CONTA GROUP BY FAP.NRO_CONTA, FAP.COD_FUNDO )
When I try to execute the query the result is the following : SQL Error [905] [42000]: ORA-00905: keyword not found
If anyone can help me, or teach me a simpler way to get the consultation done, I’d appreciate it.
What is Fg? To get SUM(FA.RESULT) there must be a GROUP BY in your external SELECT.
– anonimo
try FROM FUNDOS_APLIC fg
– Motta
I find it a little confusing that you have two queries in the same table with the same name, where one you renamed and the other not, try to rename the table FUNDOS_APLIC that performs the SUM(NRO_COTAS)
– Killdary Aguiar de Santana
I edited the code with the tips you gave me (I edited it upstairs). But the result remains the same.
– mateus silva