9. března 2016

zaplacené zálohy v PO

SELECT (select list(us.vsym)
from dba.usal as us, dba.ukonta as uk, dba.uosn as uo
where us.konto = uk.id_konto and uk.ukod  = uo.id_ukod and  uo.udruh = 'ZALOHY' and uo.druh = 1 and us.predpis > us.uhrada and us.ico = h.ico_id)

FROM DBA.opobjrady as r, DBA.opobjhd as h LEFT OUTER JOIN DBA.opobjsort as s ON h.sort = s.kod
WHERE r.id_rada = h.rada_id AND r.interni = 0
ORDER BY h.rada_id, h.id_dokl DESC

Žádné komentáře:

Okomentovat