set поле = (select конкретное_поле from ...)
update t2
set t2.field=t1.field
from t1
join t2 on t2.id=t1.id
where ...
SELECT
LoginID,
age_group = datediff(year, BirthDate, getdate()) -- или же кэйсом разбивать на интервалы
FROM HumanResources.Employee
where age_group between 25 and 30
select top 1
id, word, length
from words
order by abs(length - 5) asceding
insert into b (.....)
select * from temp where temp.field not in (select distinct field from a)
insert into b (.....)
select * from temp
left join a on temp.field=a.field
where a.field is null