Subject | Erros in firebird 1.5.x |
---|---|
Author | Cesar Romero |
Post date | 2005-02-18T14:13:13Z |
I have a query that run fine in firebird 1.03 but in 1.5.2 returns
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Invalid expression in the select list (not contained in either an
aggregate function or the GROUP BY clause).'
Why works in 1.03 and dont in 1.5.2?
SELECT I.PROTOCOLO,
I.EMOLUMENTOS,
I.TX_01,
I.TX_02,
I.TX_03,
I.TX_04, I.TX_05,
(SELECT SUM(VALOR) FROM INTIMACOES
WHERE PROTOCOLO = I.PROTOCOLO
AND DATA_RECEPCAO = I.DATA_RECEPCAO
AND TIPO_INTIMACAO = 2) AS CORREIO,
(SELECT SUM(VALOR) FROM INTIMACOES WHERE PROTOCOLO = I.PROTOCOLO
AND DATA_RECEPCAO = I.DATA_RECEPCAO
AND TIPO_INTIMACAO = 1) AS CONDUCAO,
(SELECT SUM(VALOR) FROM INTIMACOES WHERE PROTOCOLO = I.PROTOCOLO
AND DATA_RECEPCAO = I.DATA_RECEPCAO
AND TIPO_INTIMACAO = 3) AS EDITAL FROM INDICE I,
DADOS_DEVEDORE A
WHERE DATA_OCORRENCIA = :DATA
AND OCORRENCIA = 2
AND A.PROTOCOLO = I.PROTOCOLO
AND A.DATA_RECEPCAO = I.DATA_RECEPCAO
GROUP BY I.PROTOCOLO, I.EMOLUMENTOS, I.TX_01, I.TX_02, I.TX_03,
I.TX_04, I.TX_05
ORDER BY I.PROTOCOLO
regards
Cesar Romero
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Invalid expression in the select list (not contained in either an
aggregate function or the GROUP BY clause).'
Why works in 1.03 and dont in 1.5.2?
SELECT I.PROTOCOLO,
I.EMOLUMENTOS,
I.TX_01,
I.TX_02,
I.TX_03,
I.TX_04, I.TX_05,
(SELECT SUM(VALOR) FROM INTIMACOES
WHERE PROTOCOLO = I.PROTOCOLO
AND DATA_RECEPCAO = I.DATA_RECEPCAO
AND TIPO_INTIMACAO = 2) AS CORREIO,
(SELECT SUM(VALOR) FROM INTIMACOES WHERE PROTOCOLO = I.PROTOCOLO
AND DATA_RECEPCAO = I.DATA_RECEPCAO
AND TIPO_INTIMACAO = 1) AS CONDUCAO,
(SELECT SUM(VALOR) FROM INTIMACOES WHERE PROTOCOLO = I.PROTOCOLO
AND DATA_RECEPCAO = I.DATA_RECEPCAO
AND TIPO_INTIMACAO = 3) AS EDITAL FROM INDICE I,
DADOS_DEVEDORE A
WHERE DATA_OCORRENCIA = :DATA
AND OCORRENCIA = 2
AND A.PROTOCOLO = I.PROTOCOLO
AND A.DATA_RECEPCAO = I.DATA_RECEPCAO
GROUP BY I.PROTOCOLO, I.EMOLUMENTOS, I.TX_01, I.TX_02, I.TX_03,
I.TX_04, I.TX_05
ORDER BY I.PROTOCOLO
regards
Cesar Romero