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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -