sql - How to update the first digit of a number only? -
I need to update the first digits of numbers, for example, 3003
I just want to change the first '3' to '2' and do not want to change the last digit '3'.
Like some of the following faulty queries:
update table set defaulttopicorder = replacement (default detectiontracker, left (defaulttop order, 1), 2) where ....
Default tabcorder
is a non-decimal, assuming the column, this number
SET defaulttopicorder = defaulttopicorder + POWER (10, LAN (STR (default desktop))
... so If you want to subtract 1 from first Issue:
SET defaulttopicorder = defaulttopicorder + -1 * power (10, LAN (STR (default desktop))
Comments
Post a Comment