"SELECT Item_ID, SUM(Stock_Quantity) AS Quantity, Stock_Type, Batch_No FROM(dbo.Stock_Header) WHERE Item_ID =1 GROUP BY Item_ID, Stock_Type, Batch_No"")"
In my table im purchasing medicine from shops ... and selling to people..here is the format of my table
Item_ID Quantity Stock_Type
1 12 Stock IN
2 3 Stock IN
1 5 Stock OUT
NOW in item id=1 i have purchased 12 cards and sold 5 card..is there a way where i can find the query which will give me the result of how much stock i left now in item_id 1 . 12-5=7.