mysql查询字段时实现左右补零 右补0:select RPAD(id,8,'0') as pad from tmp; 左补0:select LPAD(id,8,'0') as pad from tmp;