SELECT WWSM.BUSINESS_UNIT , WWSM.WO_ID , WWSM.WO_TASK_ID , WWSM.RES_LN_NBR , SUM(DPI.QTY_PICKED) FROM PS_WM_WO_SCHED_MAT WWSM , PS_DEMAND_PHYS_INV DPI WHERE DPI.BUSINESS_UNIT = WWSM.BUSINESS_UNIT_IN AND DPI.DEMAND_SOURCE = 'WM' AND DPI.SOURCE_BUS_UNIT = WWSM.BUSINESS_UNIT AND DPI.ORDER_NO = WWSM.WO_ID AND DPI.ORDER_INT_LINE_NO = WWSM.WO_TASK_ID AND DPI.SCHED_LINE_NBR = WWSM.RES_LN_NBR AND DPI.INV_ITEM_ID = WWSM.INV_ITEM_ID AND DPI.DEMAND_LINE_NO = 1 GROUP BY WWSM.BUSINESS_UNIT, WWSM.WO_ID, WWSM.WO_TASK_ID, WWSM.RES_LN_NBR
|