I need to update File(OAKEJ/FLPJ) and Set PJPRMP(Primary Supplier) to "Y" when PJLCOS(Last Cost)= WP1COS(the Lowest Cost from OAKEJ/FLCP1WP for Part 'A 680 322 12 25'
as well as Set PJPRMP to "N" when PJLCOS>WP1COS
**************Initial SQL STATEMENT***************
SELECT PJSITE,PJSPAR,PJPRMP,PJLCOS,WP1COS
FROM OAKEJ/FLPJ JOIN FLCP1WP ON PJSITE=WP1SIT AND
PJSPAR=WP1PRT
WHERE PJSPAR='A 680 322 12 25'
ORDER BY PJSITE,PJSPAR
****************SQL RESULTS***************************
PJSITE PJSPAR PJPRMP UpdateTo PJLCOS WP1COS
MASTER A 680 322 12 25 Y (N) 13.91 13.77
MASTER A 680 322 12 25 N (Y) 13.77 13.77
MASTER A 680 322 12 25 N (Y) 13.77 13.77
MASTER A 680 322 12 25 Y (N) 13.91 13.77
MASTER A 680 322 12 25 N (Y) 13.77 13.77
Any Suggestions would be appreciated. Thanks in advance
as well as Set PJPRMP to "N" when PJLCOS>WP1COS
**************Initial SQL STATEMENT***************
SELECT PJSITE,PJSPAR,PJPRMP,PJLCOS,WP1COS
FROM OAKEJ/FLPJ JOIN FLCP1WP ON PJSITE=WP1SIT AND
PJSPAR=WP1PRT
WHERE PJSPAR='A 680 322 12 25'
ORDER BY PJSITE,PJSPAR
****************SQL RESULTS***************************
PJSITE PJSPAR PJPRMP UpdateTo PJLCOS WP1COS
MASTER A 680 322 12 25 Y (N) 13.91 13.77
MASTER A 680 322 12 25 N (Y) 13.77 13.77
MASTER A 680 322 12 25 N (Y) 13.77 13.77
MASTER A 680 322 12 25 Y (N) 13.91 13.77
MASTER A 680 322 12 25 N (Y) 13.77 13.77
Any Suggestions would be appreciated. Thanks in advance