SHARE
TWEET

Untitled

a guest Mar 24th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT DISTINCT a.suscripcion, a.linea,a.contrato,a.bonificacion,a.PRODUCTO,a.VENDEDOR,a.COD_APROB,a.COD_PLAN,a.PDV,a.fec_activ,
  2. a.fec_aprob,a.FECHA_PRIMERA_CARGA,a.PORC_COMI,a.BONI_PORTA,a.AGENTE,a.ZONA_COMER,a.DEPARTAMENTO,a.PORTADA
  3.         FROM comisv2.evt_comi_recargas a
  4.         JOIN comisv2.evt_recarga_det d ON a.linea=d.linea AND a.CONTRATO=d.CONTRATO
  5.         JOIN comisv2.CABEVENTOS c ON d.idcabevento=c.COD_CABEVENTO_PK
  6.         WHERE a.vendedor IN ('ocken', 'ocbb',
  7. 'ferremic','huancan','nunezig','cuevasar','quirogde','alonzor','cuellavi','castelld','almadape',
  8. 'ramirere','martirei','maizme','veragus','rojasnay','ramirliz','aveirola','bernalle','salcedog',
  9. 'diartef','obregoma','britvict','esquimar','miranday','ramirezg','fleitass','balmorfa','duartezu','martinso','acostaga',
  10. 'espinoal','davalole','ramirliz','ramireju','britocin','maizme',
  11. 'esquivek','aquinogl','ruizserg','paivalu','duartezu','obregoma')
  12. AND a.COMI_RECARGAS > 0 AND a.idcabevento IN (77450,77471) AND a.COD_APROB='APROB' AND (a.BONI_PORTA=0 OR a.PORTADA IS  NULL)
  13. AND d.monto > 0
  14. AND to_char(d.fecha_carga,'mm/yyyy') = to_char(to_date('18/01/2019','dd/mm/yyyy hh24:mi:ss'),'mm/yyyy')
  15. AND d.FECHA_CARGA <=  add_months(d.fec_activ, 3)
  16. AND c.str_firma = 'RECARGAS_DETALLE'
  17. AND c.STR_CONFIRMADO = 'S';
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top