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 ( 2 years ago )
SELECT A.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_PROGRAMADATOSVPC.TMP_VMVP_CAMPANIA_BPE_FROM_RIESGOS A
	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 ''
	--AND A.PERIODO = (SELECT MAX(PERIODO) FROM DLAB_PROGRAMADATOSVPC.TMP_VMVP_CAMPANIA_BPE_FROM_RIESGOS)
	AND A.NUM_RUC IN (SELECT NUM_RUC FROM DLAB_PROGRAMADATOSVPC.TMP_VMVP_RECARGA_RIESGOS)

 

Revise this Paste

Your Name: Code Language: