UPDATE per
SET note_about=nt.note_text
FROM note nt
INNER JOIN #person_membership_promo_ext per
ON per.person_id=nt.main_ref_id
and per.membership_type='P'
and note_id=(select MAX(note_id)from note nt_1
where nt_1.main_ref_id=per.person_id)