先生..你能告诉我这个PLZ的查询吗
表格1
--------------------------------
stock_name|temple|quantity|type
--------------------------------
rice |shiva | 32 |purchase
rice |shiva | 10 |issue
wheat |ganesh| 50 | purchase
wheat |ganesh| 45 | issue
ghee |ganesh| 50 | purchase
ghee |ganesh| 5 | issue
表 2 中的预期输出
--------------------------------
stock_name|temple|quantity|
--------------------------------
rice |shiva | 22 |
wheat |ganesh| 5 |
ghee |ganesh| 45 |