NYCPHP Meetup

NYPHP.org

[nycphp-talk] Global SQL Update Query Needed

Dan Cech dcech at phpwerx.net
Wed Jul 6 16:10:47 EDT 2005


http://dev.mysql.com/doc/mysql/en/string-functions.html

UPDATE mytable SET keywords = REPLACE(keywords,'moon','lunar');

Dan

Peter Sawczynec wrote:
> I need a SQL query for MySQL 4.1.
> 
> The table has over 20,000 rows. Each row has a "keywords" field. The
> keywords field has either zero words, one word or a series of colon (:)
> delimited words.
> 
> Need to swap all occurrences of the keyword "moon" with new keyword "lunar".
> What SQL query might do that.
> 
> Warmest regards,
> 
> Peter Sawczynec
> Technology Director
> PSWebcode
> ps at pswebcode.com
> 718.543.3240
> 
> 
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org




More information about the talk mailing list