SQL Server 数字字符串位数不够补0

时间:2019-10-19 16:11:57   收藏:0   阅读:393

实现思路

先给字符串左边拼接一定位数的‘0’,使用 Right函数 取 字符串右边的固定位数字符串

SQL

select right('00000000'+ '1111',8) as  bit8Numstr
--结果
--00001111

原文:https://www.cnblogs.com/Mxy-cnblog/p/11703861.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!