美文网首页
mysql查询字段时实现左右补零

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

作者: 近旁世界 | 来源:发表于2019-03-08 10:11 被阅读0次

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

    右补0:select RPAD(id,8,'0') as pad from tmp;
    左补0:select LPAD(id,8,'0') as pad from tmp;

    相关文章

      网友评论

          本文标题:mysql查询字段时实现左右补零

          本文链接:https://www.haomeiwen.com/subject/ovvlpqtx.html