declare @i int = 410853
select * from ACARI where  ISLEMNO    in (@i)
select * from STOKHARDETBAG where IslemNo=@i
(select sum(ISNULL(dbo.STOKHARDETBAG.Tutar,0)) from dbo.STOKHARDETBAG where dbo.STOKHARDETBAG.IslemNo  in (@i)  )
(select IslemNo,IslemNo3,sum(ISNULL(dbo.STOKHAR.SonTutar,0)) from dbo.STOKHAR where dbo.STOKHAR.IslemNo in (@i) or  dbo.STOKHAR.IslemNo3 in (@i) group by IslemNo,IslemNo3 )
select IslemNo,IslemNo3,CariNo,sum(SonTutar) SonTutarToplam  from dbo.STOKHAR where dbo.STOKHAR.IslemNo in (@i) or  dbo.STOKHAR.IslemNo3 in (@i) group by IslemNo,IslemNo3,CariNo 

select IslemNo3,CariNo,sum(SonTutar) from dbo.STOKHAR where 
dbo.STOKHAR.IslemNo in (@i) or  dbo.STOKHAR.IslemNo3 in (@i)  group by IslemNo3,CariNo

select * from dbo.STOKHAR where dbo.STOKHAR.IslemNo3 in (@i)  
select * from STOKHARDETBAG where IslemNo in (select IslemNo from dbo.STOKHAR where dbo.STOKHAR.IslemNo3 in (@i))
