[MySql] safe update mode 해제 & 컬럼 REPLACE

Song·2021년 12월 23일
0

DBMS

목록 보기
2/2
-- safe mode 해제
SET SQL_SAFE_UPDATES = 0;

-- 실제 replace 가 아닌 변환된 데이터 확인
SELECT REPLACE(columnName, 'origin', 'new') as content from tableName;

-- 실제 replace 진행
UPDATE tableName SET columnName = REPLACE(columnName,  'origin', 'new');
profile
Learn From Yesterday, Live Today, Hope for Tomorrow

0개의 댓글