一个table里的一列Vendor:
Vendor
021011
000339888
0000088767
用什么函数可以把前面的0都截掉呢,从左到右只从不为0的开始取,就是最后结果是
21011
339888
88767
谢大家了,我总问这种问题,因为不常用,所以总忘。
Vendor
021011
000339888
0000088767
用什么函数可以把前面的0都截掉呢,从左到右只从不为0的开始取,就是最后结果是
21011
339888
88767
谢大家了,我总问这种问题,因为不常用,所以总忘。
Vendor
021011
000339888
0000088767
用什么函数可以把前面的0都截掉呢,从左到右只从不为0的开始取,就是最后结果是
21011
339888
88767
谢大家了,我总问这种问题,因为不常用,所以总忘。select cast(verndor as bigint) from tb
--查询
select stuff(verdor,1,1,'') from table where left(verdor,1)='0'
--修改
update table set verdor=stuff(verdor,1,1,'') where left(verdor,1)='0'