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.これは便利な場合には必要なテキスト文字列を検索して置換するに多くのレコードまたは行の数に影響を与えるなど、変更の会社名、郵便番号、 URLやスペルの間違いです。

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’)更新プログラムを設定client_table company_name =置き換える( 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.上記の声明に取って代わるのすべてのインスタンスを'古い会社'から'新会社の' company_nameのclient_tableの分野での表のとおりです。

Another example:別の例:

SELECT REPLACE(’www.mysql.com’, ‘w’, ‘Ww’);選択置き換える( ' www.mysql.com ' 、 'ワット' 、 '見てなかった' ) ;

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 私のデジタルライフフォーラム .です。



7 Responses to “How to Find and Replace Text in MySQL Database using SQL” 7レスポンスを"内のテキストを置換する方法を検索し、 MySQLデータベースを使用してのSQL "

  1. masterik
    May 4th, 2007 05:48 2007年5月4日05:48
    1

    Thanks a lot!どうもありがとう! You’ve saved my life!保存したら私の人生!

  2. yourtronica
    May 11th, 2007 10:38 2007年5月11日10:38
    2

    Thanks for the help!助けてくれてありがとう!

  3. Joostヨースト
    May 16th, 2007 07:24 2007年5月16日07:24
    3

    Excellent, just what I needed.素晴らしい、まさに私が欲しかったものです。 Thanks!ありがとう!

  4. How to Move WordPress Blog to New Domain or Location » My Digital Life WordPressのブログに移動する方法を新しいドメインまたは場所»私のデジタルライフ
    October 1st, 2007 18:23 2007年10月1日18:23
    4

    [...] 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のテーブルが格納さ[...]

  5. Monicaモニカ
    June 4th, 2008 15:43 2008年6月4日15:43
    5

    thanks, this is very helpful!!ありがとう、これは非常に助かるよ! !

  6. Tux Training » Blog Archive » How to Move WordPress Blog to New Domain or Locationトゥクストレーニング»ブログのアーカイブ» WordPressのブログに移動する方法を新しいドメインまたは場所
    September 1st, 2008 01:48 2008年9月1日01:48
    6

    [...] 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のテーブルが格納さ[...]

  7. sbsxrx
    September 10th, 2008 21:52 2008年9月10日21:52
    7

    Algo k es puede resultar practico es cuando se necesita eliminar un caracter de una sere de registros es:アルゴリズムkはpuede resultar practicoはcuando se necesita削除国連caracterデuna干からびたデregistrosは:

    update tabla1 set campo1=replace(campo1,’8′,”);更新プログラムのtabla1設定campo1 =置き換える( campo1 、 '8 ',");

    esta sentencia eliminaria todos los 8 de la tabla: tabla1 del registro: campo1このsentencia eliminariaすべてのロス8デラタブラ: tabla1デル申込み: campo1

    (NOTA: las comillas son todas simples). (注:ラスコミージャスの息子todasするだけで済みます) 。

Leave a Reply残して返信

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> これらのタグを使用することができます: <aのhref=のtitle= <abbrのtitle= <blockquote cite=""> <cite> <acronymのtitle= <b>ダウンロードの<code> <デル日時= " " >の<em> <i>て<strike> <strong> <q cite="">

Subscribe without commenting登録なしのコメント


Custom Search

New Articles新しい記事

Incoming Search Terms for the Article検索用語を受信するには

mysql replace MySQLの置換 - - sql replace のSQL置き換える - - replace mysql MySQLの置き換え - - mysql find and replace MySQLの検索と置換 - - sql replace command のSQLコマンドを置き換える - - Mysql find replace MySQLの検索置換 - - sql find replace のSQL検索置換 - - mysql string replace MySQLの文字列に置き換え - - mysql replace string MySQLの置換後の文字列 - - mysql replace text MySQLのテキストを置換 - - SQL replace text テキストの置換のSQL - - REPLACE SQL 置換のSQL - - MySQL replace function MySQLの置換機能 - - sql search and replace のSQL検索と置換 - - mysql search and replace MySQLの検索と置換 - - sql find and replace のSQL検索と置換 - - mySQL search replace MySQLの検索置換 - - REPLACE IN MYSQL MySQLの置き換え - - sql replace string 置換後の文字列のSQL - - sql replace function のSQL置換機能 - - mysql replace syntax MySQLのREPLACE構文 - - mysql replace MySQLの置換 - - find and replace in sql 検索と置換をSQL - - replace in sql 置換をSQL - - find and replace sql 検索と置換のSQL - - mysql replace example MySQLの置き換え例 - - sql string replace SQL文字列に置き換え - - find replace mysql MySQLの検索置換 - - find replace sql 検索置換のSQL - - find and replace mysql MySQLの検索と置換 - - sql replace mysql のMySQLのSQL置き換える - - REPLACE command in sql 置換コマンドをSQL - - SQL replace のSQL置き換える - - sql replace syntax のSQL REPLACE構文 - - replace sql command SQLコマンドを置き換える - - replace text mysql MySQLのテキストを置換 - - mysql replace command MySQLのコマンドを置き換える - - mysql text replace MySQLのテキストを置き換える - - find and replace SQL query SQLクエリの検索と置換 - - replace text sql テキストの置換のSQL - - MySQL Replace() MySQLの置き換え( ) - - search and replace mysql MySQLの検索と置換 - - search replace mysql MySQLの検索置換 - - mysql sql REPLACE のMySQLのSQL置き換える - - mysql search and replace text MySQLの検索と置換テキスト - - mysql find MySQLの検索 - - string replace mysql MySQLの文字列に置き換え - - mysql replace sql MySQLの置換のSQL - - MySQL REPLACE statement MySQLのREPLACEステートメント - - sql replace all すべてのSQL置き換える - - all すべての - - mysql update replace text MySQLの更新プログラムのテキストを置換 - - REPLACE function sql 置換機能のSQL - - sql + replace のSQL +置き換える - - replace text in mysql 内のテキストを置換のMySQL - - find replace in sql 検索置換をSQL - - mysql replace string function MySQLの置換後の文字列関数 - - string replace SQL 文字列置換のSQL - - sql replace examples 例のSQLに置き換えます - - replace function in sql 置換機能をSQL - - sql search replace SQL検索置換 - - sql replace example 例のSQLに置き換えます - - find and replace in mysql MySQLの検索と置換 - - sql command replace SQLコマンドを置き換える - - search and replace in mysql MySQLの検索と置換 - - mysql replace text MySQLのテキストを置換 - - mysql replace table MySQLの置き換えテーブル - - sql text replace SQLテキストに置き換えます - - replace text in SQL 内のテキストを置換のSQL - - replace command sql 置換コマンドのSQL - - sql replace statement のSQL REPLACEステートメント - - sql find text テキストのSQLを検索 - - replace string sql 置換後の文字列のSQL - - mysql + replace MySQLの+置き換える - - mysql text search and replace MySQLのテキストの検索と置換 - -