How to Find and Replace Text in MySQL Database using SQL Ako nájsť a nahradiť text v MySQL databáze pomocou 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). Databáza MySQL je šikovný a jednoduchý reťazec funkcie REPLACE (), ktorá umožňuje dáta tabuľky s zodpovedajúci reťazec (from_string), ktoré majú byť nahradené novými 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. To je užitočné v prípade, že je potrebné hľadať a nahradiť textový reťazec, ktorý ovplyvňuje veľa záznamov alebo riadkov, ako je napríklad zmena názvu spoločnosti, PSČ, URL alebo pravopisné chyby.

The syntax of REPLACE is REPLACE(text_string, from_string, to_string) Syntax je REPLACE REPLACE (text_string, from_string, to_string)

MySQL reference MySQL referencie 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. REPLACE opisuje ako funkcia, ktorá vráti reťazec text_string všetky výskyty reťazca from_string nahrádza reťazec to_string, kde zhoda je case-sensitive pri vyhľadávania from_string. text_string can be retrieved from the a field in the database table too. text_string možno získať z poľa v databázovej tabuľke príliš. Most SQL command can be REPLACE() function, especially SELECT and UPDATE manipulation statement. Väčšina môže byť SQL príkaz REPLACE () funkcie, a to najmä SELECT a UPDATE manipulácia vyhlásenia.

For example: Napríklad:

update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, 'find this string', 'replace found string with this string'); Aktualizácia TABLE_NAME nastaviť field_name = replace (field_name, 'nájsť tento reťazec', 'nájdených nahradiť reťazec s týmto string');

update client_table set company_name = replace(company_name, 'Old Company', 'New Company') Aktualizácia client_table nastaviť company_name = replace (company_name, 'Staré Company', 'New Company')

The above statement will replace all instances of 'Old Company' to 'New Company' in the field of company_name of client_table table. Vyššie uvedené tvrdenie nahradí všetky výskyty 'Staré Company' na 'New Company' v oblasti company_name na client_table tabuľky.

Another example: Iný príklad:

SELECT REPLACE('www.mysql.com', 'w', 'Ww'); SELECT REPLACE ( 'www.mysql.com', 'w', 'Ww');

Above statement will return 'WwWwWw.mysql.com' as result. Vyššie uvedené tvrdenie sa vráti 'WwWwWw.mysql.com' ako výsledok.

IMPORTANT : The page is machine translated and provided "as is" without warranty. Upozornenie: stránka je stroje preložené a za predpokladu, "ako je" bez záruky. Machine translation may be difficult to understand. Strojový preklad môže byť ťažké pochopiť. Please refer to Nájdete na original English article originál Anglicky artikl whenever possible. ak je to možné.


28 Responses to “How to Find and Replace Text in MySQL Database using SQL” 28 Reakcie na "Ako nájsť a nahradiť text v MySQL databáze pomocou SQL"

Pages: [2] Stránky: [2] 1 1 » » Show All Zobraziť všetky

  1. timtak timtak
    October 28th, 2009 09:00 28.říjen 2009 09:00
    28 28

    I am looking for a way to do this globally accross a whole database. Hľadám spôsob, ako to dosiahnuť globálne naprieč celou databáz.

  2. kevin kevin
    October 20th, 2009 20:28 20.říjen 2009 20:28
    27 27

    Doesn't work at all for replacing web addresses within a database. Nefunguje vôbec pre nahradenie webovej adresy do databázy.

  3. vishwas Vishwas
    September 30th, 2009 15:26 30.září 2009 15:26
    26 26

    Wanted to use REPLACE command to use for a column of a table…and this helped me…thanks Chcel využiť REPLACE príkazu na použitie pre stĺpec tabuľky ... a to mi pomohlo ... vďaka

Pages: [2] Stránky: [2] 1 1 » » Show All Zobraziť všetky

Leave a Reply 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> Môžete použiť tieto značky: href = "" <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. Prihlásiť sa k pripomienkam funkcia bola zakázaná. To receive notification of latest comments posted, subscribe to Ak chcete dostávať oznámenia o najnovšie komentáre vyslaný, prihláste sa My Digital Life Comments RSS feed Má Digital Life Komentáre RSS or alebo register to receive zaregistrovať na new comments in daily email digest. nové komentáre v dennom email Digest.
Custom Search

New Articles Nové články

Incoming Search Terms for the Article Vcházející Hľadať Čas do člen určitý Artikel

mysql replace mysql nahradiť - -- sql find and replace sql nájsť a nahradiť - -- MySQL replace text MySQL nahradiť text - -- replace mysql nahradenie mysql - -- sql find replace sql nájsť nahradiť - -- MySQL search and replace MySQL vyhľadávanie a nahrádzanie - -- replace in mysql nahradiť v mysql - -- sql replace text sql nahradiť text - -- mysql replace example mysql nahradiť napríklad - -- mysql find and replace mysql nájsť a nahradiť - -- find replace sql nájsť nahradiť sql - -- mysql update text mysql úprava textu - -- mysql replace string mysql nahradiť reťazec - -- mysql search and replace string mysql vyhľadávanie a nahradzovanie reťazcov - -- search and replace mysql vyhľadávanie a nahradzovanie mysql - -- find replace sql query nájsť nahradenie SQL dotazu - -- find replace mysql nájsť nahradenie mysql - -- find replace in mysql nájsť nahradiť v mysql - -- find and replace mysql nájsť a nahradiť mysql - -- mysql string REPLACE mysql string REPLACE - -- mysql find mysql nájsť - -- update replace mysql aktualizácia nahradiť mysql - -- find and replace using sql nájsť a nahradiť pomocou SQL - -- find and replace sql nájsť a nahradiť sql - -- mysql update replace string mysql aktualizácia nahradiť reťazec - -- mysql substitute string mysql náhradné string - -- mysql replace all mysql nahradiť všetky - -- mysql find replace mysql nájsť nahradiť - -- mysql replace command mysql nahradiť príkaz - -- mysql select replace mysql vybrať nahradiť - -- mysql search and replace data in database mysql vyhľadávanie a nahradzovanie dát v databáze - -- MYSQL REPLACE SYNTAX MYSQL REPLACE SYNTAX - -- php mysql replace php mysql nahradiť - -- replace in mysql query nahradiť v mysql dotazu - -- replace mysql syntax nahradenie mysql syntax - -- replace word within description sql nahradiť slovo v popise sql - -- replace sql nahradiť sql - -- replace mysql example nahradiť napríklad mysql - -- Replace text string sql Nahradiť text string sql - -- replace mysqkl nahradiť mysqkl - -- search and replace sql vyhľadávanie a nahradzovanie sql - -- search and replace in mysql vyhľadávanie a nahradzovanie v mysql - -- sql replace text in table sql nahradiť text v tabuľke - -- sql update search and replace SQL UPDATE vyhľadávanie a nahrádzanie - -- sql search and replace sql vyhľadávanie a nahrádzanie - -- sql replace example sql nahradiť napríklad - -- sql search and replace query SQL dotazu vyhľadávanie a nahrádzanie - -- sql query search and replace SQL dotazu vyhľadávanie a nahrádzanie - -- sql find replace sql nájsť nahradiť - -- sql replace string statement string sql nahradí výpis - --