Ver originalSELECT t1.user_id, SUM(t1.clics) totclics FROM (SELECT user_id, COUNT(DISTINCT producto_id) clicsFROM tracking_productos GROUP BY FLOOR(visitdate/1800), user_idHAVING clics > 0)t1 GROUP BY t1.user_id