Advertisement
Guest User

Untitled

a guest
Jan 17th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.12 KB | None | 0 0
  1. SELECT
  2.  
  3. i.f120_referencia
  4. --,mayor.f106_id
  5. --,mvtoentidad.f753_dato_numero
  6. FROM unoee.dbo.t120_mc_items i
  7. INNER JOIN unoee.dbo.t121_mc_items_extensiones ext ON i.f120_rowid = ext.f121_rowid_item
  8. INNER JOIN unoee.dbo.t125_mc_items_criterios criterios1 ON i.f120_rowid = criterios1.f125_rowid_item
  9. AND criterios1.f125_id_plan = '016'
  10. INNER JOIN unoee.dbo.t125_mc_items_criterios criterios2 ON i.f120_rowid = criterios2.f125_rowid_item
  11. AND criterios2.f125_id_plan = '025' AND criterios2.f125_id_criterio_mayor = '001'
  12. INNER JOIN unoee.dbo.t106_mc_criterios_item_mayores mayor ON mayor.f106_id_plan = criterios1.f125_id_plan
  13. AND mayor.f106_id = criterios1.f125_id_criterio_mayor
  14. LEFT JOIN unoee.dbo.t753_mm_movto_entidad_columna mvtoentidad ON i.f120_rowid_movto_entidad = mvtoentidad.f753_rowid_movto_entidad AND mvtoentidad.f753_rowid_entidad_atributo IN('58','59')
  15. WHERE
  16. -- mvtoentidad.f753_rowid_entidad_atributo IN('58','59')
  17.  (mvtoentidad.f753_dato_numero IS NULL
  18. OR  mayor.f106_id = '0000')
  19. AND i.f120_referencia NOT LIKE '%CINTA%'
  20. AND ext.f121_ind_estado = 1
  21.  
  22. GROUP BY
  23. i.f120_referencia
  24. ORDER BY i.f120_referencia
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement