sql update column value based on join table