I have the query below, and cannot make it return the the desired results, in fact it returns nothing. I have determined the problem is with the decode statement, but am unsure as to what I need to change in order for it to work.
here are the results by running the query without the decode statements C0495
the t_zone_loca table results are
WH_ID ZONE LOCATION_ID PICK_SEQ
GDC CGM1L1 CG0495 0001.
Pack code for this would be 'CG'
and t_fwd_pick.location_id is cg0495
FROM T_FWD_PICK, T_LOCATION
WHERE T_FWD_PICK.item_number = rec_cur_order.item_number
AND T_FWD_PICK.wh_id = rec_cur_order.wh_id
AND T_FWD_PICK.TYPE = 'PRM'
AND EXISTS (
WHERE wh_id = rec_cur_order.wh_id
WHEN location_id =
AND ZONE =
AND ZONE <>
END = 1)
AND T_FWD_PICK.location_id = T_LOCATION.location_id
AND T_FWD_PICK.wh_id = T_LOCATION.wh_id
AND T_LOCATION.status != 'I'
AND ROWNUM = 1;
thanks in advance for any advice or suggestions that you give.