How to Find and Replace Text in MySQL Database using SQL कैसे को ढूँढें और बदलें पाठ MySQL डाटाबेस में एसक्यूएल प्रयोग
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 डाटाबेस का काम और आसान स्ट्रिंग समारोह REPLACE है () है कि मिलान (वाक्यांश 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) REPLACE के वाक्यविन्यास REPLACE 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. समारोह के रूप में REPLACE का वर्णन करता है कि रिटर्न from_string स्ट्रिंग to_string, जहां से मेल खाने वाले मामले के प्रति संवेदनशील जब from_string के लिए खोज रहा है की जगह तार की सभी घटनाओं के साथ तार text_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. सबसे एसक्यूएल कमान REPLACE () समारोह में, विशेष रूप से चुनें और अद्यतन हेरफेर बयान हो सकता है.
For example: उदाहरण के लिए:
update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, 'find this string', 'replace found string with this string'); अद्यतन TABLE_NAME 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. ऊपर बयान 'के सभी उदाहरणों का स्थान ले लेगा पुराने' कंपनी 'के लिए नई' कंपनी client_table तालिका के company_name के क्षेत्र में.
Another example: एक और उदाहरण:
SELECT REPLACE('www.mysql.com', 'w', 'Ww'); का चयन करें REPLACE '(' www.mysql.com ',' w ',' ww);
Above statement will return 'WwWwWw.mysql.com' as result. ऊपर बयान 'वापसी परिणाम' WwWwWw.mysql.com के रूप में होगा.
IMPORTANT : The page is machine translated and provided "as is" without warranty. महत्वपूर्ण: पृष्ठ की मशीन है और अनुवाद प्रदान "के रूप में वारंटी के बिना है." Machine translation may be difficult to understand. मशीन अनुवाद मुश्किल से समझ सकते हो. Please refer to कृपया उल्लेख करने original English article मूल अंग्रेजी लेख whenever possible. जब भी संभव है.
Related Articles संबंधित लेख
- Remove or Trim First or Last Few Characters in MySQL Database with SQL निकालें या छाँटो पहले या अंतिम एसक्यूएल के साथ MySQL डाटाबेस में कुछ वर्ण
- Check and Optimize MySQL Database Automatically with Crontab/Cron जाँच करें और अनुकूलन MySQL Crontab के साथ स्वत: डाटाबेस / Cron
- MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length MySQL त्रुटि 1170 (42000): BLOB / पाठ एक कुंजी लंबाई बिना कुंजी विवरण में प्रयुक्त स्तम्भ
- MySQL Database Performance Tuning Best Practices Video Tutorial MySQL डाटाबेस के प्रदर्शन ट्यूनिंग उत्तम आचरण वीडियो ट्यूटोरियल
- Enable Logging of Slow Queries (Slow Query Log) in MySQL Database सक्षम MySQL में धीरे प्रश्न (धीरे क्वेरी लॉग इन करें) का डाटाबेस लॉग इन
- Change and Reset MySQL root Password परिवर्तन और रीसेट MySQL रूट पासवर्ड
- Replace Notepad with Another Text Editor (eg. Notepad2 and Notepad++) in Vista की जगह एक और आलेख (eg. Notepad2 और नोटपैड + +) Vista में संपादक के साथ Notepad
- Download File Content Replacer to Search and Replace Text in Multiple Files डाउनलोड फ़ाइल में एकाधिक सामग्री खोजें और बदलें पाठ को Replacer फ़ाइलें
- Using PHP-MySQL Persistent Connections to Run WordPress Blog का उपयोग कर PHP-MySQL लगातार सम्पर्क भागो WordPress के लिए ब्लॉग
- How to Backup and Restore (Export and Import) MySQL Databases Tutorial बैकअप और पुनर्स्थापित करने के लिए कैसे निर्यात (और आयात) MySQL डेटाबेस ट्यूटोरियल










































October 28th, 2009 09:00 28 अक्टूबर 2009 09:00
I am looking for a way to do this globally accross a whole database. मैं एक तरह से यह एक संपूर्ण डेटाबेस भर में दुनिया भर में कर के लिए देख रहा हूँ.
October 20th, 2009 20:28 20 अक्टूबर 2009 20:28
Doesn't work at all for replacing web addresses within a database. एक डेटाबेस के भीतर वेब पते के स्थान के लिए बिल्कुल काम नहीं है.
September 30th, 2009 15:26 30 सितम्बर 2009 15:26
Wanted to use REPLACE command to use for a column of a table…and this helped me…thanks स्थानापन्न करने के लिए कमांड का प्रयोग कर एक टेबल के एक स्तंभ के लिए उपयोग ... और यह मेरी मदद की तलाश है ... धन्यवाद