update Sterilisation set sterilizationPurposeid = (select max(id) from HttpOption where optionText = Sterilisation.sterilizationPurpose and optionListId = 'sterilizationPurpose') where sterilizationPurposeid is null and sterilizationPurpose is not null;