i have two columns source_id and Qty in one table TRANS. Source_id Qty 2002 100 2002 200 2002 500 2002 -500 i want to get balance of this source_id which is 100+200=300 because (-500+500=0) how can i write a query for this and can i show 100 and 200 saparate in two lines as balance
SELECT [Source_id], SUM([Qty]) FROM [YourTableName] GROUP BY([Source_id])
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)