2

I have a varchar field with latitude values.
I would like to replace part of the string, the "integer" part,

for example:

7.215555
2.584555
23.154525
12.54836
44.124556

should change to:

20.215555
20.584555
20.154525
20.54836
20.124556

Thanks in advance for your help.

1 Answer 1

4

If 20 is a hardcoded string you want to replace with values before point you can do so

UPDATE table 
SET latitude = CONCAT('20.',SUBSTRING_INDEX(latitude ,'.',-1))

Fiddle Demo

Sign up to request clarification or add additional context in comments.

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.