我需要有关此查询的帮助
这是我查询的实际结果
price received qty recieved price release qty release
10.30 10 0 0
0 0 10.30 2
0 0 10.30 1
19.20 20 0 0
0 0 19.20 5
0 0 19.20 3
0 0 19.20 1
在我的查询中使用此代码
$result = mysql_query("SELECT *,
SUM(CASE WHEN qtyreceived > 0 THEN qtyreceived END) AS qtyrec,
SUM(CASE WHEN qtyrelease > 0 THEN qtyrelease END) AS qtyrel
FROM stockledger
WHERE stockdesc= '$_POST[desc]' GROUP BY pricerelease,pricereceived ");
结果是
收到价格 qtyreceived 价格发布 qtyrelease bal 10.30 10 10 19.20 20 20 10.30 3 -3 19.20 9 -9
我想以这种方式查看结果,这样我就可以得到 2 个价格的剩余数字
price received qtyreceived price release qtyrelease bal
10.30 10 10.30 3 7
19.20 20 19.20 9 11
谢谢.....;