0

enter image description here

This is my database structure. I want to update mobileno column where length(mobileno)!= 13 , and add 88 string before them . Like 017126875493 becomes 88017126875493

2 Answers 2

1

You can try using concat()

UPDATE tablename SET mobileno = concat('88',mobileno)
WHERE length(mobileno) != 13;
Sign up to request clarification or add additional context in comments.

Comments

0

Solved it by using concat()

UPDATE passenger.mobileno
SET passenger.mobileno= CASE
   WHEN length(passenger.mobileno)=11 THEN CONCAT("88",passenger.mobileno)
   ELSE passenger.mobileno

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.