minus varchar mysql

field b is varchar but all of them is number   4.1  4 12.5  41 20 3.2   how can  minus  1 for all member
Who is Participating?
Guy Hengel [angelIII / a3]Billing EngineerCommented:
why is the field varchar, if it contains all numbers?

anyhow, for the math/update, you do a cast:
update yourtable set yourfield = cast(yourfield as DECIMAL) -1

Open in new window

hope this helps
select convert(b,decimal) - 1
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.