Monday, September 17, 2018

Join between MTL tables -- Oracle Apps

Join between MTL tables -- Oracle Apps

SELECT
mta.organization_id org_id,
OOD.ORGANIZATION_NAME,
mta.inventory_item_id inv_id,
MSIB.SEGMENT1,
MSIB.DESCRIPTION,
mtt.transaction_type_name,
mta.transaction_date,
(mta.PRIMARY_QUANTITY*-1) AS PRIMQTY,
(mta.base_transaction_value*-1) AS Base_Val
FROM
APPS.mtl_parameters mtp,
APPS.mtl_transaction_accounts mta,
APPS.mtl_material_transactions  mmt,
APPS.mtl_transaction_types mtt,
ORG_ORGANIZATION_DEFINITIONS OOD,
MTL_SYSTEM_ITEMS_B MSIB
WHERE
mta.transaction_id = mmt.transaction_id
AND mmt.transaction_type_id = mtt.transaction_type_id
AND mtp.material_account = mta.reference_account
AND mtp.organization_id = mta.organization_id
AND mta.organization_id = OOD.organization_id
AND MSIB.ORGANIZATION_ID = OOD.ORGANIZATION_ID
AND MSIB.INVENTORY_ITEM_ID = MTA.INVENTORY_ITEM_ID
AND mta.primary_quantity <= 0
AND TRUNC (mta.transaction_date) BETWEEN :SDATE AND  :EDATE

No comments:

Post a Comment

SQL Important Queries

  How to delete rows with no where clause The following example deletes  all rows  from the  Person.Person  the table in the AdventureWork...