Advertisement
Guest User

Untitled

a guest
Jul 12th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. select * from op_anticipo_emp op
  2. inner join documento d on d.id=op.op_id
  3. left join (select sum(doc.importe_moneda_base) suma, rg.op_anticipo_emp_id from RG_GASTO_EMPLEADO rg inner join documento doc on doc.id=rg.op_id group by rg.op_anticipo_emp_id) kk on kk.op_anticipo_emp_id=d.id
  4. where d.duenio='dsalguero' and (d.importe_moneda_base>kk.suma or kk.suma is null)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement