Ver Mensaje Individual
  #2 (permalink)  
Antiguo 08/06/2016, 13:02
Avatar de Libras
Libras
Colaborador
 
Fecha de Ingreso: agosto-2006
Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 17 años, 9 meses
Puntos: 774
Respuesta: Sumar solo números positivos

Código MySQL:
Ver original
  1. select sum(puntos) as total, user_id from tabla  where puntos>0 group by user_id

Con eso :)
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me