乱码的问题我自己解决了,但就是计算某个时间点的库存数量时出现了问题,数量和ONHAND里面的数量对不上,相差很大!
select moq.inventory_item_id,moq.transaction_quantity-sum_qty.qty tq_qty
from mtl_onhand_quantities moq,
(select organization_id,inventory_item_id,sum(mmt.primary_quantity) qty
from mtl_material_transactions mmt
group by organization_id,mmt.inventory_item_id) sum_qty
where moq.inventory_item_id=sum_qty.inventory_item_id
我用上面语句查询是,为什么TQ_QTY数量不为零,请高手指点!