Simple SQL Update with Join and Where Exists

UPDATE Part_Master
SET RECVEN_01 = VENID_10
from Part_Master as P INNER join Order_Master as O ON P.PRTNUM_01 = O.PRTNUM_10
WHERE EXISTS
(SELECT PRTNUM_10, VENID_10
FROM Part_Master as P join Order_Master as O ON P.PRTNUM_01 = O.PRTNUM_10
WHERE TYPE_01 = ‘B’ OR TYPE_01 = ‘O’
GROUP BY PRTNUM_10, VENID_10)

About Vincent Stefanetti

Vincent Stefanetti Senior Consultant MAX Manufacturing Software Working with MAX and Related Technologies Since 1987 MAX ERP System Implementations and Projects MAX, Dynamics GP, Synergy, Event Manager, Crystal Reports, SQL Reporting Services, Database and System Migrations and Updates, MAX Training Classes - All Levels, Custom Reporting.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply