Cita:
dónde listadoAerolineas es un parámetro, un string, al que si le meto los valores de modo por ej. IB", "SPP", "AEM es decir, como una lista de strings pero sin las comillas inicial y final, en otros casos, otros reportes me funciona perfectamente, pero con esta consulta no, y no tengo ni idea de porqué. Y si le meto por ejemplo solamente el valor IB, sólo un valor, entonces me funciona bien, pero necesito meterle varios. select
companies.company as compania,
(select
count(*)
from `aodb`.`arrivalflight` a
where a.iataCompanyCode = compania and a.scheduledTime >= $P{fechaInformeDesde} and a.scheduledTime < $P{fechaInformeHasta}
) as numArr,
(select
count(*)
from `aodb`.`departureflight` b
where b.iataCompanyCode = compania and b.scheduledTime >= $P{fechaInformeDesde} and b.scheduledTime < $P{fechaInformeHasta}
) as numDep,
(
(select
count(*)
from `aodb`.`arrivalflight` a
where a.iataCompanyCode = compania and a.scheduledTime >= $P{fechaInformeDesde} and a.scheduledTime < $P{fechaInformeHasta}
)
+
(select
count(*)
from `aodb`.`departureflight` b
where b.iataCompanyCode = compania and b.scheduledTime >= $P{fechaInformeDesde} and b.scheduledTime < $P{fechaInformeHasta}
)
) as totalMov
from
(select distinct
e.iataCompanyCode as company
from `aodb`.`arrivalFlight` e where e.iataCompanyCode in ($P{listadoAerolineas})
union
(select distinct
f.iataCompanyCode as company
from `aodb`.`departureflight` f where f.iataCompanyCode in ($P{listadoAerolineas})
)
) as companies;
companies.company as compania,
(select
count(*)
from `aodb`.`arrivalflight` a
where a.iataCompanyCode = compania and a.scheduledTime >= $P{fechaInformeDesde} and a.scheduledTime < $P{fechaInformeHasta}
) as numArr,
(select
count(*)
from `aodb`.`departureflight` b
where b.iataCompanyCode = compania and b.scheduledTime >= $P{fechaInformeDesde} and b.scheduledTime < $P{fechaInformeHasta}
) as numDep,
(
(select
count(*)
from `aodb`.`arrivalflight` a
where a.iataCompanyCode = compania and a.scheduledTime >= $P{fechaInformeDesde} and a.scheduledTime < $P{fechaInformeHasta}
)
+
(select
count(*)
from `aodb`.`departureflight` b
where b.iataCompanyCode = compania and b.scheduledTime >= $P{fechaInformeDesde} and b.scheduledTime < $P{fechaInformeHasta}
)
) as totalMov
from
(select distinct
e.iataCompanyCode as company
from `aodb`.`arrivalFlight` e where e.iataCompanyCode in ($P{listadoAerolineas})
union
(select distinct
f.iataCompanyCode as company
from `aodb`.`departureflight` f where f.iataCompanyCode in ($P{listadoAerolineas})
)
) as companies;
¿Puede alguien echarme un cable? No comprendo porqué en unos sitios sí y en otros no, me estoy haciendo un lío.
Muchas gracias