strSql.Append("select a.id,a.productID,c.name,c.gridusername,c.costprice,a.productnum,a.sellprice,a.productnum*c.costprice as sumprice,a.lastAllotTime,b.shopname,b.id as shopid from product_stocks a, shop_info b,product_info c,grid_info d");
            strSql.Append(" where a.productID = c.id and a.gridusername = c.gridusername and a.gridusername = d.gridusername and d.shopusername = b.shopusername and a.gridID = d.id and a.gridusername = '" + username + "'");
这个是我的SQL语句,我现在想当productID,shopid 相等的时候,a.productnum的值可以相加,怎样改写??