Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so dont bother with any of their useless mail servers here and just use oauth login instead. Thank the nice Russians for causing that. :)
Paste
Pasted as SQL by registered user vvillacorta ( 3 years ago )
SELECT periodo_campania,
num_ruc,
MAX(CASE WHEN lower(gestion_tipo) LIKE '%acepta%' AND lower(gestion_tipo) NOT LIKE '%no%' AND lower(gestion_tipo) NOT LIKE '%visita%' THEN 1 ELSE 0 END) flg_acepta_vpconnect
FROM d_mdl_vpc_disc.HM_GESTION_VPCONNECT_SQAD C
WHERE 1 = 1
and periodo_campania >= '202206'
AND lower(tipo_campania) LIKE '%adq%'
AND (
flg_activo = 1 OR (gestion_tipo IS NOT NULL AND gestion_tipo NOT LIKE '')
)
AND NUM_RUC IS NOT NULL
AND NUM_RUC NOT LIKE ''
AND NUM_RUC != '.'
GROUP BY periodo_campania, num_ruc
ORDER BY periodo_campania DESC, num_ruc
Revise this Paste