Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] web/email now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as SQL by registered user vvillacorta ( 1 year 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

Your Name: Code Language: