Ver Mensaje Individual
  #3  
Antiguo 03-05-2005
hmoner hmoner is offline
Miembro
 
Registrado: may 2005
Posts: 52
Reputación: 20
hmoner Va por buen camino
Hola fly
Mil gracias por la ayuda...

La 1º consulta funciono de maravillas !!! eres un maestro !
pero la 2º consulta me ha dado el siguiente error:

SELECT CL.nombre AS Cliente, SUM(C.monto) AS Total, SUM(C.monto / P.dinero * P.puntos) AS Puntos, P.nombre AS Promo
FROM Compra C
INNER JOIN Cliente CL ON CL.id=C.idcliente
INNER JOIN Promocion P ON P.id=C.idpromo
GROUP BY CL.nombre, P.nombre
ORDER BY CL.nombre

Error: P.nombre AS Promo must appear before aggregate columns in the selection list [no error code]

y luego la puse asi, tal cual dice el error, y funciono...

SELECT P.nombre AS Promo, CL.nombre AS Cliente, SUM(C.monto) AS Total, SUM(C.monto / P.euros * P.puntos) AS Puntos
FROM FACTURACION C
INNER JOIN CLIENTE CL ON CL.id=C.idcliente
INNER JOIN PROMOCION P ON P.id=C.idpromo
GROUP BY CL.nombre, P.nombre
ORDER BY CL.nombre

DE MARAVILLAS !!

Millon de gracias man !!
Responder Con Cita