Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- i.f120_referencia
- --,mayor.f106_id
- --,mvtoentidad.f753_dato_numero
- FROM unoee.dbo.t120_mc_items i
- INNER JOIN unoee.dbo.t121_mc_items_extensiones ext ON i.f120_rowid = ext.f121_rowid_item
- INNER JOIN unoee.dbo.t125_mc_items_criterios criterios1 ON i.f120_rowid = criterios1.f125_rowid_item
- AND criterios1.f125_id_plan = '016'
- INNER JOIN unoee.dbo.t125_mc_items_criterios criterios2 ON i.f120_rowid = criterios2.f125_rowid_item
- AND criterios2.f125_id_plan = '025' AND criterios2.f125_id_criterio_mayor = '001'
- INNER JOIN unoee.dbo.t106_mc_criterios_item_mayores mayor ON mayor.f106_id_plan = criterios1.f125_id_plan
- AND mayor.f106_id = criterios1.f125_id_criterio_mayor
- 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')
- WHERE
- -- mvtoentidad.f753_rowid_entidad_atributo IN('58','59')
- (mvtoentidad.f753_dato_numero IS NULL
- OR mayor.f106_id = '0000')
- AND i.f120_referencia NOT LIKE '%CINTA%'
- AND ext.f121_ind_estado = 1
- GROUP BY
- i.f120_referencia
- ORDER BY i.f120_referencia
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement