Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. SELECT c.Numero_Tarjeta, c.Nombre, c.Apellidos, COUNT(c.Numero_Tarjeta) AS Total_Compras_2018
  2. FROM CLIENTES_HIPERBER c
  3. LEFT OUTER JOIN MOVIMIENTOS_CLUB_HIPERBER m
  4. ON m.Numero_Tarjeta = c.Numero_Tarjeta
  5. WHERE (m.Fecha_Compra > '2018') AND (m.Fecha_Compra < '2019') AND (c.Empleado = 'S')
  6. GROUP BY c.Numero_Tarjeta, c.Nombre, c.Apellidos
  7. ORDER BY Total_Compras_2018 DES
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement