SQL에서 update할경우 그 해당 LIKE에서 찾았던 글자만 바꾸기
본문
예를들어서
introduce_data이라는 테이블에 address 컬럼에
경상남도 거제시 아주1로2길 48
이라는 DB정보가 들어 있습니다.
이것을
경상남도 거제시 아주1로2길 48 -> 경남 거제시 아주1로2길 48
이렇게만 바꿀려고 합니다.
sql: update introduce_data set address = ???? where address %경상남도%
이렇게는 해봤는데 ㅠ,ㅠ
답변 부탁드립니다. ㅠ.ㅠ
답변 3
replace 쓰세요.
UPDATE introduce_data SET address = REPLACE(address, "경상남도", "경남")
그렇게 할 필요가있나요?
update table set where no='$no' and address='$address'
이렇게..
아니면말고
update table set where no='$no' and address='$address'
이렇게..
아니면말고
정규표현식을 쓰면 됩니다
regexp sql 찾아보세요.
답변을 작성하시기 전에 로그인 해주세요.