sql - mysql query - credit debit-> calculate balance (complex tables structure) -


i have tables structure:

enter image description here

the "plati" table = credit.

the "suma" column = amount.

sample debit data:

enter image description here

sample credit data:

enter image description here

and want result:

plati.id
debite.iddosar
debite.suma
plati.suma plata
(debite.suma - previous plati.suma order plati.data) restplata

like excel:

enter image description here

is possible sql query not variable, because want split query's create 1 view on finally?


Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -