I have a table where one field named "version" contains the string "MyProgram nnnnnn". I now wish to replace these strings so that they are only "nnnnnn", thereby remove the prepending "MyProgram ".
Is this possible, and if so, how would I do this?
I have a table where one field named "version" contains the string "MyProgram nnnnnn". I now wish to replace these strings so that they are only "nnnnnn", thereby remove the prepending "MyProgram ".
Is this possible, and if so, how would I do this?
If the pattern is "MyProgram nnnnnn"
maning string like VB 1.3, Mysql 5.6, PHP 5.4
etc then you can do the following
update tablename
set col = substring_index(col,' ',-1)
Use Replace function,
SELECT VERSION,
REPLACE(VERSION,'MyProgram nnnnnn','nnnnnn')
FROM FROM tablename
Check this Manual
SELECT REPLACE(VERSION, 'MyProgram ', '')
FROM tablename
You can use the Replace() function for MySQL
update table set columnname = REPLACE(columnname, 'MyProgram ', '');
You want:
I now wish to replace these strings so that they are only "nnnnnn"
Shortest solution:
SELECT 'nnnnnn'
Specify your pattern of the content of this column!
SELECT VERSION,
REPLACE(VERSION,'MyProgram nnnnnn','nnnnnn')
FROM FROM tablename
Regards, Praveen Nelge