例如,我有一个customer [ID s from]字段
ID
1, 2, 3, 4, 5, ...
但是我想将格式更改为
010101, 010102, 010103, 010104, 010105, ...
它显示在我的数据库和模板上。
有什么办法吗?
您不能将前导0加到整数并存储在db中,您只能管理选择结果。例如
select concat('0101', lpad(yourcol,2,'0') from your table