I have a problem with the query, locally it works fine but on the server it shows me "Subquery returns more than 1 row" If I put :
select value
from cngv field
where cngv.month>='9'
and cngv.month<='9'
and cngv.anno='2022'
and cngv.idField='8'
and cngv.cvl=username
It works perfect but I'm interested if you ask me from 1 to 9
SELECT `anno`,
( select valor
from campo cngv
where cngv.mes>='1'
and cngv.mes<='9'
and cngv.anno='2022'
and cngv.idCampo='8'
and cngv.cvl=username
) as numfilles ,
`a`.`nombre` as `tipo`,
concat(format(SUM(totalp+totalsp), 0, 'de_DE'), '€') as Totalpartners,
concat(format(SUM(totalap+totalacp+totalsp+totalscp), 0, 'de_DE'), '€') as Total,
concat(format(SUM(Totalac+Totalsc), 0, 'de_DE'), '€') as TotalComputado,
concat(format(SUM(Totalac), 0, 'de_DE'), '€') as totala,
concat(format(SUM(Totalac), 0, 'de_DE'), '€') as totalac,
concat(format(SUM(Totalscp), 0, 'de_DE'), '€') as totalsmartpartners,
concat(format(SUM(TotalSmartCaptado+TotalSmartCaptadoPartners), 0, 'de_DE'), '€') as totals,
concat(format(SUM(Totalsc), 0, 'de_DE'), '€') as totalsc,
concat(format(SUM(Totalsc+Totalscp+Totalac), 0, 'de_DE'), '€') as totalcaptado,
`img`.`CVL`,
`img`.`CVLDescendiente`,
CONCAT(`first_name`, ' ', `Last_name`) as first_name
FROM `informe_mensual_gestor` `img`
JOIN `users` u ON username = img.v
INNER JOIN areas a ON a.id = u.Area
WHERE `img`.`v` in (6609114, 93764)
AND `img`.`Anno` = '2022'
AND `img`.`Mes` >= '9'
AND `img`.`Mes` <= '9'
GROUP BY `Last_name`