to_char(1, ‘000 ‘)函数1
select to_char(1, '000 ') from demo
1 | select right( '00 '+cast(CustomerID as varchar(3)),3) from ... |
right((10000+字段名),3)就是3位的.
支持可以处理得简单些:1
select right( '00 '+cast(CustomerID as varchar(3)),3) from ...
to_char(1, ‘000 ‘)函数1
select to_char(1, '000 ') from demo
1 | select right( '00 '+cast(CustomerID as varchar(3)),3) from ... |
right((10000+字段名),3)就是3位的.
支持可以处理得简单些:1
select right( '00 '+cast(CustomerID as varchar(3)),3) from ...