mysql查询字段时实现左右补零

右补0:select RPAD(id,8,‘0’) as num from tmp;左补0:select LPAD(id,8,‘0’) as num from tmp;参数 :id:为字段名称 8:为补全的位数 0:代表补的参数0
mysql查询字段时实现左右补零
右补0:select RPAD(id,8,‘0’) as num from tmp;
左补0:select LPAD(id,8,‘0’) as num from tmp;

参数 :
id:为字段名称
8:为补全的位数
0:代表补的参数02022-06-29
mengvlog 阅读 414 次 更新于 2025-10-29 05:25:58 我来答关注问题0
檬味博客在线解答立即免费咨询

mySQL相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部