网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 服务器与数据库 > MySQL
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Reply
 
Thread Tools Display Modes
  #1   IP: 204.45.15.210
Old 2015-12-19, 10:59 PM
Maribel Maribel is offline
初级会员
 
Join Date: 2012-12-09
Posts: 1
Maribel 现在声名狼藉
Default how to find and replace a word in a mysql column?

I have a column containing list of streets. I need to replace 'eyeglasses' with 'glasses'. The replacement can be made in the current column or in a new column with the address in the required format. The following is the sample data. 'Column 1' contains the data in current format. 'Column 2' contains the data in the desired format.
Code:
Column 1         Column 2
cheap eyeglasses  cheap glasses
sports sunglasses       sports sunglasses
discount eyeglasses   discount glasses
There are about 1000 products at www.bestpriceglasses.com, if modify one by one, too much trouble. I think it is really a good idea if I can modify via MySQL command.
Reply With Quote
  #2   IP: 204.45.15.210
Old 2015-12-19, 11:02 PM
New Britain New Britain is offline
初级会员
 
Join Date: 2007-08-11
Posts: 1
New Britain 现在声名狼藉
Default

This query works for this:
Code:
UPDATE table SET column = REPLACE(column, 'eyeglasses', 'glasses');
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Find and Replace Text in MySQL Database using SQL topvip MySQL 0 2012-07-10 08:12 AM

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 03:05 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.