Thursday, January 7, 2010

update with join from a table with one field


To update a field from other table were we want one that field and we know there is a join.


update tableA
set Email = b.email
from tableA a inner join tableAbkp b on a.UserName = b.Username
where b.UserName not like '%user01%'

so here is an example to do the trick


No comments: