24-11-19, 09:48 PM
select tabel1.name1,tabel1.txt, tabel1.id, sum(iif (test1.teep=1,test1.mony, 0)) as ouut, sum(iif (test1.teep=0,test1.mony, 0))as book,iif(book-ouut>0,book-ouut,(book-ouut)*-1) as good,iif(book-ouut>0,'no','yas') as video from tabel1 inner join test1 on tabel1.id = test1.id where 1=1 group by tabel1.name1,tabel1.txt, tabel1.id