Así me da el error detallado más abajo:
SELECT v_Fecha, CASE WHEN v_Importe >= 0 THEN MAX(v_Importe) ELSE
MIN(v_Importe) END AS Venta
FROM t_Ventas
GROUP BY v_Fecha
ORDER BY v_Fecha
Servidor: mensaje 8120, nivel 16, estado 1, línea 1
Column 'v_Importe' is invalid in the select list because it is not contained
in either an aggregate function or the GROUP BY clause.
Así me funciona:
SELECT v_Fecha, MAX(v_Importe) AS Venta
FROM t_Ventas
GROUP BY v_Fecha
ORDER BY v_Fecha
Cuál es la diferencia ?
Muchas gracias de antemano
saludos
Gabriel
Leer las respuestas