当前位置: 代码迷 >> Sql Server >> 去掉前导零
  详细解决方案

去掉前导零

热度:8   发布时间:2016-04-27 12:12:40.0
去掉前导0
01
002
0003333A
怎么去掉前面的所有0呢?

------解决方案--------------------
SQL code
update tbset col = stuff(col,1,patindex('%[^0]%',col)-1,'')where left(col,1) = 0
  相关解决方案