select
NVL(TR_QTY, 0) - (
NVL(TR_QTY_B, 0) + NVL(TR_QTY_C, 0)
) res_qty
from
(
SELECT
(
SELECT
SUM(transaction_quantity)
FROM
INV_ONHAND_QUANTITIES_DETAIL
WHERE
inventory_item_id = 100000000615408
AND organization_id = 300000002138348
AND subinventory_code IN (
SELECT
SECONDARY_INVENTORY_NAME
FROM
INV_SECONDARY_INVENTORIES
WHERE
organization_id = 300000002138348
AND reservable_type = '2'
)
) AS TR_QTY_C,
(
SELECT
SUM(RESERVATION_QUANTITY)
FROM
INV_RESERVATIONS
WHERE
inventory_item_id = 100000000615408
AND organization_id = 300000002138348
) AS TR_QTY_B,
(
SELECT
SUM(transaction_quantity)
FROM
INV_ONHAND_QUANTITIES_DETAIL
WHERE
inventory_item_id = 100000000615408
AND organization_id = 300000002138348
) AS TR_QTY
from
egp_system_items_b MB1
where
1 = 1
AND (
mb1.organization_id = 300000002138348
)
AND (
mb1.inventory_item_id = 100000000615408
)
);

1 comments:
⭐ Online BA Analyst Course
Enroll in a complete online BA analyst course to learn from fundamentals to advanced topics.
The program covers Agile methodology, stakeholder mapping, and functional modeling.
Practical case studies help you relate concepts to real business problems.
Interactive discussions improve your critical thinking and communication skills.
Expert guidance ensures you understand each concept clearly.
Flexible batches allow you to balance learning with other commitments.
This training equips you for roles like BA consultant, analyst, and project coordinator.
Post a Comment