replace - Replacing text in a MySQL query? -
i have column in table, lets call thecolumn. values in column either number, 100036077, or number followed name, 35921 john doe.
i want replace names nothing , add 1000 5 numbers in front of name (35921 john doe --> 100035921) in select. how can without using additional libraries? there no native regex replace mysql, right?
thanks!
this bit easy... or missing something?
select concat('1000',substring_index('35921 john doe',' ',1))x; +-----------+ | x | +-----------+ | 100035921 | +-----------+
Comments
Post a Comment