2007年6月17日 星期日

變更MySQL欄位中某段文字的SQL語法

My table looks like this

+----------------+
| column_name |
+----------------+
| abcOLDdefOLd |
| OLDjklmOLD |
| tuvwxyzOLDOLD|
+----------------+

To change only first occurrence of the string 'OLD' into 'NEW'
we can use following query. (Replace wont work as it replaces all occurrences)


(繼續閱讀....)