2014-09-04 1 views
0

정규식에서 OR 연산자를 사용하여 작동하지 않는 여러 세트를 업데이트하는 데 문제가 있습니다.SQL에 대한 정규 표현식에서 OR 연산자를 사용하는 방법

[email protected] 
[email protected] 
[email protected] 
[email protected] 
[email protected] 

result should look like this: 

[email protected] 
[email protected] 
[email protected] 
[email protected] 
[email protected] 


I've tried that update procedure for using OR operator like this and it didn't work at all: 

update dbo.Membership 
set Email = left(Email, charindex('@', Email, 0)) + 'dony.com' 
OR Email= left(Email, charindex('@', Email, 0)) + 'bony.com'; 
+0

당신은 "bony.com"를 포함하지 않는 "dony"를 대체 할 주소를 업데이트 할? 원하는이 무엇입니까 : 나는에서 업데이트하려고 해요 @ *. com을 위해? – Beth

답변

0

당신이

update dbo.Membership 
set Email = left(Email, charindex('@', Email, 0)) + 'dony.com' 
WHERE Email NOT LIKE '%@bony.com' 
관련 문제