Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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
length(mobileno)!= 13
You can try using concat()
concat()
UPDATE tablename SET mobileno = concat('88',mobileno) WHERE length(mobileno) != 13;
Add a comment
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
Required, but never shown
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.
Explore related questions
See similar questions with these tags.