ASP - invalid in the select list because it is not contained in either an aggregate function or the GROUP

 
Vista:
sin imagen de perfil
Val: 44
Ha mantenido su posición en ASP (en relación al último mes)
Gráfica de ASP

invalid in the select list because it is not contained in either an aggregate function or the GROUP

Publicado por J@m (79 intervenciones) el 11/08/2011 16:55:17
como agrego a la consulta el campo RMT_CAIN, me genera el sigiente error:

Column 'cont_tras.rmt_cain' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.



La consulta es la siguiente:

"SELECT RMT_CAIN, ref_prod, sum(cant_ing) as cant_tras FROM cont_tras where fec_est >='"&fec_ini&"' and fec_est <='"&fec_fin& "' group by ref_prod"

Gracias.

Cali - Colombia
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

invalid in the select list because it is not contained in either an aggregate function or the GROUP

Publicado por fernanda (14 intervenciones) el 25/08/2011 16:34:47
"SELECT RMT_CAIN, ref_prod, sum(cant_ing) as cant_tras FROM cont_tras where fec_est >='"&fec_ini&"' and fec_est <='"&fec_fin& "' group by ref_prod, RMT_CAIN"

agregue el campo en el group by
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar