场景:mysql表table存的日期列为dt,数据格式为yymmdd,例如:20191030 select concat(substr(dt,1,4),'-',substr(dt,5,2),'-',substr(dt,7,2)) from table where dt = '20191030' 结果是:2019-10-30 来源:https://www.cnblogs.com/xuebf/p/11767944.html 标签 substr table