SHARE
TWEET

Untitled

a guest Oct 4th, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   SELECT COUNT(contrato) can, contrato,estado_corte,NOMBRECLIENTE,CEDNIT,DIRECCION,CICLO,departamento,CIUDAD,ESTRATO FROM (      
  2.         SELECT sc.SUSCCODI CONTRATO, cor.escodesc estado_corte, UPPER(sc.SUSCNOMB) NOMBRECLIENTE,sc.SUSCNITC CEDNIT
  3.         ,dc.dccodico DIRECCION,sc.susccicl CICLO,de.depadesc departamento, lo.locanomb CIUDAD,scat.sucadesc ESTRATO, sesuserv
  4.         FROM suscripc sc, servsusc ss,flex.departam de, flex.localida lo, flex.subcateg scat, flex.estacort cor, dicocobr dc
  5.         WHERE sc.susccodi = ss.sesususc
  6.         AND sc.suscdcco = dc.dccocodi
  7.         AND ss.sesusesb = -1 --Servicios Principales
  8.         --and ss.sesuesco in ('11','1','92') --Estados de corte facturables
  9.         AND ss.sesuesco NOT IN ('100') --Estados de corte facturables
  10.         AND sc.suscdepa = de.depacodi
  11.         AND sc.suscdepa = lo.locadepa
  12.         AND sc.suscloca = lo.locacodi
  13.         AND ss.sesuesco = cor.escocodi
  14.         AND ss.sesucate = scat.sucacate
  15.         AND ss.sesusuca = scat.sucacodi
  16.         --and ss.sesuserv not in ('8111','8083')
  17.         AND suscnitc = '43163166'
  18.         )
  19.         GROUP BY contrato,estado_corte,NOMBRECLIENTE,CEDNIT,DIRECCION,CICLO,departamento,CIUDAD,ESTRATO
  20.         ORDER BY  ESTADO_CORTE ASC
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top