Erro de Group By
Estou usando o Firebird 1.5 e não estou conseguindo utilizar o group by
vejam minha select
Vejam o erro
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).
Desde já obrigado pela ajuda
vejam minha select
select registro,Data,Conta_Movimentada,ContraPartida,Nlancamento,complemento, Valor_D,Valor_C ,sum(registro) from lco_101 where idcliente=1 group by Data
Vejam o erro
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).
Desde já obrigado pela ajuda
Ricas
Curtidas 0
Respostas
Aroldo Zanela
14/10/2004
Colega,
Isto:
ou isto:
Isto:
select registro,Data,Conta_Movimentada,ContraPartida,Nlancamento,complemento, Valor_D,Valor_C ,sum(registro) from lco_101 where idcliente=1 group by registro,Data,Conta_Movimentada,ContraPartida,Nlancamento,complemento, Valor_D,Valor_C
ou isto:
select Data, sum(registro) from lco_101 where idcliente=1 group by Data
GOSTEI 0
Ricas
14/10/2004
Valeu, estou acustumado com o MYSQL, e com ele eu poderia agrupar apenas com um campo, como no meu modelo
GOSTEI 0