select WE.WIP_ENTITY_NAME
,MSI.SEGMENT1
,MSI.DESCRIPTION
,WDJ.CLASS_CODE
,WDJ.START_QUANTITY
,wdj.SCHEDULED_START_DATE
,wdj.SCHEDULED_COMPLETION_DATE
,WDJ.QUANTITY_COMPLETED
,WDJ.STATUS_TYPE
from wip.WIP_ENTITIES we
,wip.WIP_DISCRETE_JOBS wdj
,INV.MTL_SYSTEM_ITEMS_B MSI
where we.WIP_ENTITY_ID=wdj.WIP_ENTITY_ID
AND MSI.INVENTORY_ITEM_ID=WDJ.PRIMARY_ITEM_ID
AND MSI.ORGANIZATION_ID=WDJ.ORGANIZATION_ID
AND WDJ.ORGANIZATION_ID=X
AND WDJ.STATUS_TYPE in (1,3)
AND WDJ.START_QUANTITY=WDJ.QUANTITY_COMPLETED