UPDATE person SET urls = (REPLACE(urls,'xh',id)); UPDATE person SET urls = (REPLACE(urls,'xh','hx'));