varchar列の値に1つまたは複数の文字を簡単に挿入するMySQL関数はありますか?
次のテキストを設定したい:
B U 1 U 09 2011 Segs 1, 3 - 10 24 hours
に
B U 1 U N 09 2011 Segs 1, 3 - 10 24 hours
それをSELECT
使用する値に使用できます:
select concat(left(col, 8), 'N ', substring(col, 9))
from table1
必要に応じて、UPDATE
次を使用できます。
update table1
set col = concat(left(col, 8), 'N ', substring(col, 9))
SQL FiddlewithDemoを参照してください
試す:
SELECT INSERT('B U 1 U 09 2011 Segs 1, 3 - 10 24 hours', 8, 0, ' N');
SQL フィドル: http://sqlfiddle.com/#!2/d41d8/3998
詳細: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_insert