Categories
How to replace the first digit of a number in MySQL?
Hello. Can you please tell me what query can be used to replace the first digit 8 with 7 in the column with phone numbers in the MySQL database. table users column phone
Answer the question
In order to leave comments, you need to log in
UPDATE users SET phone = CONCAT('7', SUBSTR(phone, 2)) WHERE LEFT(phone, 1) = '8';
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question