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

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -