Я не уверен, что это будет работать для MySQL.Но в MSSQL вы можете сделать это следующим образом:
UPDATE MyTable
SET salary = (select top 1 salary from MyTable where zipcode = t1.zipcode and salary is not null)
FROM MyTable t1
WHERE t1.salary is null
Вам необходимо проверить эквивалентный случай объединения для mysql.
Ref.Тестовый запрос:
create table #temp (id int, salary decimal(18,2), zipcode varchar(10))
insert into #temp values (1,56052.45,02456)
insert into #temp values (2,NULL,1023)
insert into #temp values (3,39089.28,1023)
insert into #temp values (4,46063.72,03795)
insert into #temp values (5,NULL,02456)
UPDATE #temp
SET salary = (select top 1 salary from #temp where zipcode = t1.zipcode and salary is not null)
FROM #temp t1
WHERE t1.salary is null
select * from #temp
drop table #temp