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 ( 2 years ago )
SELECT COALESCE(A.periodo, '202405') periodo, A.campania,
T.KEY_VALUE coddoc, M.KEY_VALUE num_ruc,
A.scorefinal_nr, A.primariesgo, A.oferta_calculada, A.rmaactual_bpe_final, A.rmaactual_consumo,
A.cemoferta, A.CEMOPERATIVO, A.costo_fondo_real, A.costo_fondo_redondeado, A.gasto_operativo,
A.margen_comercial, A.tasapiso_real, A.tasapiso_redondeado
FROM DLAB_MODELOS.TMP_VMVP_CAMPANIA_BPE_FROM_RIESGOS_X A ----------- todo la base de riesgos
LEFT JOIN E_DW_VIEWS.V_MST_ENCRIP_NRO_DOC_MDL_HISTDIA M
ON A.NUM_RUC = M.NRO_DOC
LEFT JOIN E_DW_VIEWS.V_MST_ENCRIP_NRO_DOC_MDL_HISTDIA T
ON A.CODDOC = T.NRO_DOC AND A.CODDOC <> '.' AND A.CODDOC IS NOT NULL AND A.CODDOC NOT LIKE ''
WHERE 1 = 1
AND A.NUM_RUC <> '.'
AND A.NUM_RUC IS NOT NULL
AND A.NUM_RUC NOT LIKE ''
Revise this Paste
Children: 127672