How to Find and Replace Text in MySQL Database using SQL mysql 데이터베이스를하는 방법을 찾기 및 바꾸기를 사용하여 텍스트를 sql
MySQL database has a handy and simple string function REPLACE() that allows table data with the matching string (from_string) to be replaced by new string (to_string). mysql 데이터베이스가 편리하고 단순 문자열 기능을 대체할 ()를 통해 테이블 데이터가 일치하는 문자열 (from_string)을 새 문자열로 대체 (to_string). This is useful if there is need to search and replace a text string which affects many records or rows, such as change of company name, postcode, URL or spelling mistake. 이것은이 필요한 경우에 유용하고 대체하는 텍스트 문자열을 검색하거나 많은 레코드 어떤 영향을 미치는 행의 변화와 같은 회사 이름, 우편 번호, 홈페이지 또는 맞춤법 실수를합니다.
The syntax of REPLACE is REPLACE(text_string, from_string, to_string) 대체의 구문은 바꾸기 (text_string, from_string, to_string)
MySQL reference mysql 참조 describes REPLACE as function that returns the string text_string with all occurrences of the string from_string replaced by the string to_string, where matching is case-sensitive when searching for from_string. 교체로 함수에 대해 설명을 반환하는 text_string의 문자열로 대체됩니다 from_string의 모든 문자열을 대상 문자열의 to_string, 어디를 검색할 때 검색은 사례 - 민감한 from_string합니다. text_string can be retrieved from the a field in the database table too. text_string의 필드에서 검색할 수있습니다 데이터베이스에서 테이블을 너무합니다. Most SQL command can be REPLACE() function, especially SELECT and UPDATE manipulation statement. 대부분의 sql 명령을 바꿀 수있습니다 () 함수는, 특히 조작 성명 및 업데이 트를 선택합니다.
For example: 예를 들면 :
update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this string’, ‘replace found string with this string’); 업데이 트를 테이블 세트 field_name = 바꾸기 (field_name, '검색이 문자열을', '대체 찾은 문자열을 해당 문자열');
update client_table set company_name = replace(company_name, ‘Old Company’, ‘New Company’) 업데이트 company_name = client_table 설정 바꾸기 (company_name, '오래된 회사', '새 회사')
The above statement will replace all instances of ‘Old Company’ to ‘New Company’ in the field of company_name of client_table table. 위의 문장을 대체의 모든 인스턴스의 '오래된 회사'에서 '새 회사'client_table 테이블의 분야에서 company_name합니다.
Another example: 또 다른 예 :
SELECT REPLACE(’www.mysql.com’, ‘w’, ‘Ww’); 바꾸기를 선택 ( 'www.mysql.com', '승', 'ww');
Above statement will return ‘WwWwWw.mysql.com’ as result. 위의 문장은 반환 'wwwwww.mysql.com'결과합니다.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 중요 사항 : 이것은 기계 번역 페이지는 "있는 그대로"제공하지 않고 보증합니다. Machine translation may be difficult to understand. 기계 번역을 이해하기 어려울 수있습니다. Please refer to 를 참조하시기 바랍니다 original English article 기존 영어 자료 whenever possible. 언제 수있습니다.
Share and contribute or get technical support and help at 를 공유하고 기술 지원 및 도움을 공헌하지 않는다면 My Digital Life Forums 내 디지털 라이프 공개 토론 . 합니다.
Related Articles 관련 기사
- How to Move WordPress Blog to New Domain or Location wordpress 블로그를 새 도메인을 이동하는 방법이나 위치
- Remove or Trim First or Last Few Characters in MySQL Database with SQL 첫 번째 또는 마지막 몇 문자를 손질을 제거하거나 데이터베이스를 mysql sql
- Change or Set MySQL Long Query Time Value for log-slow-queries mysql 긴 시간 값을 설정을 변경하거나 로그 - 느리게 - 검색어를 쿼리
- How to Backup and Restore (Export and Import) MySQL Databases Tutorial 백업 및 복원하는 방법을 (수출과 수입) mysql 데이터베이스의 튜토리얼
- Enable Logging of Slow Queries (Slow Query Log) in MySQL Database 느린 쿼리를 로깅 사용 (느린 검색어 로그)에 mysql 데이터베이스를
- WordPress MySQL SQL Query Error in WPDB Class wpdb 클래스에 오류가 mysql sql 쿼리를 wordpress
- MySQL Database Performance Tuning Best Practices Video Tutorial mysql 데이터베이스 성능 튜닝 모범 사례 동영상 튜토리얼
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4 windows XP 용 웹 서버에 설치와 apache2, php5, mysql4 - 4 부
- Change and Reset MySQL root Password mysql 루트 암호를 변경 및 재설정
- MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length mysql 오류 1170 (42000) : blob / 텍스트 칼럼에 사용되는 주요 사양없이는 키 길이

































May 4th, 2007 05:48 2007년 5월 4일 05:48
Thanks a lot! 대단히 감사합니다! You’ve saved my life! 넌 내 생명을 구해!
May 11th, 2007 10:38 2007년 5월 11일 10:38
Thanks for the help! 도움을 주셔서 감사합니다!
May 16th, 2007 07:24 2007년 5월 16일 07:24
Excellent, just what I needed. 우수한, 내가이 필요합니다. Thanks! 감사합니다!
October 1st, 2007 18:23 2007년 10월 1일 18:23
[...] The guide uses SQL statements based on MySQL replace() function to modify the database. [...]이 가이드를 사용 mysql sql 예상치에 기초한 대체 () 함수를 수정하는 데이터베이스를합니다. To run SQL queries, login to MySQL database that houses WordPress tables [...] 를 실행하는 sql 쿼리, mysql 데이터베이스에 로그인하여 테이블을 [...] 주택 wordpress
June 4th, 2008 15:43 2008년 6월 4일 15:43
thanks, this is very helpful!! 감사합니다, 이것은 매우 도움이!
September 1st, 2008 01:48 2008년 9월 1일 01:48
[...] The guide uses SQL statements based on MySQL replace() function to modify the database. [...]이 가이드를 사용 mysql sql 예상치에 기초한 대체 () 함수를 수정하는 데이터베이스를합니다. To run SQL queries, login to MySQL database that houses WordPress tables [...] 를 실행하는 sql 쿼리, mysql 데이터베이스에 로그인하여 테이블을 [...] 주택 wordpress
September 10th, 2008 21:52 2008년 9월 10일 21:52
Algo k es puede resultar practico es cuando se necesita eliminar un caracter de una sere de registros es: 무언가 k는있을 수 resultar practico 삭제 요구는 물건을 남동 유엔 caracter 어 은아 에즈 세르 드 registros은 :
update tabla1 set campo1=replace(campo1,’8′,”); 업데이 트를 campo1 = tabla1 설정 바꾸기 (campo1, '8 ',");
esta sentencia eliminaria todos los 8 de la tabla: tabla1 del registro: campo1 이 모든 로스 eliminaria sentencia 8 드 라 tabla : tabla1 델 신청 : campo1
(NOTA: las comillas son todas simples). (주 : 라스 comillas 아들 앗 simples).