[MySQL] 데이터 치환하기
·
Development/MySql
replace()함수를 사용하여 데이터를 치환할 수 있다. # 테이블 데이터 조회 select * from table_name where idx = 1 and status_code!= 3 # 변경할 값 확인 SELECT REPLACE(name, 'ABC0', 'ABC00') AS 'replaced_data' FROM table_name where idx = 1 and status_code!= 3 and name like "%ABC0%" # update로 값 변경 UPDATE table_name SET name = REPLACE(name, 'ABC0', 'ABC00') where idx = 1 and status_code!= 3 and name like "%ABC0%" 검색결과에서 abc0과 abc00의 ..