I have a Master table with pid_name column varchar(40) and I want to update that pid_name colulmn with pname from another table processes.
Processes table has 2 column pid and pname with 100 distinct rows.
pid from master table has more than 50K distinct values for pid_name. I want to update pid_name with all values from processes table and NULL which does not exists in processes table.
I am using Redshift Database. Thanks in advance
Master Table before update
Expected output in Master table after update
(Since it does not exist in processes table)
UPDATE master SET pid_name = (SELECT pname FROM processes p WHERE p.pid = master.pid_name);