Posted on: 7/17/2012 7:37:15 AM | Views : 305

Hello I have below query. Problem is that i cant see all records of depotanimlari table. Because of there is where stokhaketid = @id at SQL query. But i need to see only @id record. Also i need to see all records of depotanimlari. How can i do this ?
SELECT t2.x_id AS x_id, t2.x_kod AS x_kod, t2.x_adi AS x_adi, (ISNULL(SUM(t1.x_girismiktartemel),0)) x_giris, (ISNULL(SUM(t1.x_cikismiktartemel),0)) x_cikis, (ISNULL(SUM(t1.x_girismiktartemel),0)-ISNULL(SUM(t1.x_cikismiktartemel),0)) x_mevcut FROM x_depotanimlari t2 LEFT OUTER JOIN x_stokhareket t1 ON t2.x_id =t1.x_depoid WHERE (t1.x_stokid = @x_stokid) GROUP BY t1.x_stokid, t2.x_id, t2.x_kod, t2.x_adi ...

Go to the complete details ...