如下表:

MySQL中,把varchar类型转为date类型

先使用str_to_date函数,将其varchar类型转为日期类型,然后从小到大排序

语法:select str_to_date(class_time,'%Y%m%d %H:%i:%s') a from a order by  a desc ;

MySQL中,把varchar类型转为date类型

 

相关文章:

  • 2021-11-18
  • 2021-12-10
  • 2021-11-06
  • 2021-09-13
  • 2021-09-13
  • 2019-07-24
  • 2021-09-29
  • 2021-11-26
猜你喜欢
  • 2021-01-08
  • 2022-01-07
  • 2021-09-29
  • 2021-12-06
  • 2021-11-18
  • 2021-09-29
  • 2021-06-22
  • 2021-11-24
相关资源
相似解决方案