Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT c.Numero_Tarjeta, c.Nombre, c.Apellidos, COUNT(c.Numero_Tarjeta) AS Total_Compras_2018
- FROM CLIENTES_HIPERBER c
- LEFT OUTER JOIN MOVIMIENTOS_CLUB_HIPERBER m
- ON m.Numero_Tarjeta = c.Numero_Tarjeta
- WHERE (m.Fecha_Compra > '2018') AND (m.Fecha_Compra < '2019') AND (c.Empleado = 'S')
- GROUP BY c.Numero_Tarjeta, c.Nombre, c.Apellidos
- ORDER BY Total_Compras_2018 DES
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement