1

I have a column in my table as number of type varchar(15). This contains phone numbers. I would like to append a constant country code to each of the phone numbers. i.e if the number is 1234567890 I want it to be updated to 911234567890 where '91' is the country code. Is there a simple way to do this or do I have to run a loop through all the rows?

2 Answers 2

3
UPDATE table SET number = CONCAT('91', number) 
Sign up to request clarification or add additional context in comments.

Comments

2

try this:

UPDATE tablename SET number=concat('91',number); 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.