|
|
Subject:
SQL syntax question (mySQL)
Category: Computers > Programming Asked by: davidsch-ga List Price: $7.00 |
Posted:
18 Feb 2005 16:38 PST
Expires: 18 Feb 2005 21:38 PST Question ID: 476871 |
SQL syntax: I am working with mySQL. How do I write a SQL statement which updates a table as follows: - In table "Table_X", - For field "Field_Y", which is of type char(64), - For each record that contains one or more instances of the string "ab" in "Field_Y", - Replace "ab" with "cde" for all instances of "ab". |
|
There is no answer at this time. |
|
Subject:
Re: SQL syntax question (mySQL)
From: goodfoo-ga on 18 Feb 2005 20:12 PST |
MySQL 4.1 has nice function called REPLACE - most engines do not have such a thing. http://dev.mysql.com/doc/mysql/en/string-functions.html For your example: update Table_X set Field_Y = replace(Field_Y, 'ab', 'cde' ); The double reference to Field_Y is allowed. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |