Pleasure resort of Gleam™

SQL : Microsoft SQL Server 2000 Standard / Enterprise Edition


원본 데이터
111aaabbb
222aaabbb
333aaabbb
444aaabbb
555aaabbb

111cccddd
222cccddd
333cccddd
444cccddd
555cccddd
이런식으로...

update 테이블 set 컬럼 = replace(컬럼,'aaabbb','cccddd') where 조건

Ex)
update member set email = replace(email,'hanmail.com','hanmail.net') where mailling = 1 and email like '[_a-zA-Z0-9-\.]%' and email like '%@hanmail.com'

update member set email = replace(email,'never.com','naver.com') where mailling = 1 and email like '[_a-zA-Z0-9-\.]%' and email like '%@never.com'

update member set email = replace(email,'hanmil.net','hanmail.net') where mailling = 1 and email like '[_a-zA-Z0-9-\.]%' and email like '%@hanmil.net'

Comment +0