select id, id2, debito, credito, 
  sum(debito-credito) over (partition BY id ORDER BY id, id2) saldo
	select, 0 id2, importe debito, 0 credito
		from m_cxc m 
	union all 
	select c.id_m_cxc id, id2, debito, credito
		from d_cxc c 
  		where c.id_m_cxc=:id
) a
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter