En esta consulta que tengo desarrollada me devuelve cero registros.
A continuación le dejo el código que tengo hasta ahora para ver si me pueden ayudar.
Gracias.
Código:
SELECT
t1.suscriberid AS id,
@var1:=t2.pyear AS año,
(SELECT
IF(SUM(payments_global.commission),
SUM(payments_global.commission),
0)
FROM
payments_global
WHERE
payments_global.p_number = bob_global.suscriberid
AND payments_global.pyear = @var1
AND payments_global.month = '01') AS ene
FROM
bob_global t1
LEFT JOIN
payments_global t2 ON t1.suscriberid = t2.p_number
WHERE
1 AND t2.pyear = '2020'
AND t1.id_insured = '2'
GROUP BY t1.suscriberid
HAVING ene = '0'