String To Date Conversion in Mysql -


i have column values 20150921. want convert string value specified date format 2015-09-21 in mysql.

try this:

date_format(str_to_date('20150921', '%y%m%d'),'%y-%m-%d') 

sql fiddle demo

(assuming want date format in yyyy-mm-dd format)


Comments

Popular posts from this blog

xml - Extract substrings with XSLT -

math - "ELO Rating" and how does "TSR Rating" work? -

How can do a tuple comparison in coffeescript similar to that in python? -