select c.id_cli, Sum(i.ingresos) from clientes c left join ingresos i on c.id_cli=i.id_cli and i.iva <> 0 group by id_cli