我想改变日期格式“28 may 14”形式为“28-may-14”的形式使用sql [英] i want to change date formate "28 may 14" to the form of "28-may-14" using sql
本文介绍了我想改变日期格式“28 may 14”形式为“28-may-14”的形式使用sql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
希望用' - '替换' - '使用sql查询
want to replace 'space' by '-' using sql query
推荐答案
不要。
不要存储将日期作为字符串 - 将其存储为DATE或DATETIME值,然后让您的演示文稿软件处理显示格式。
您可以这样做:
Don't.
Don't store the date as a string at all - store it as a DATE or DATETIME value instead, and let your presentation software handle the format for the display.
You can do it:
REPLACE('28 may 14', ' ', '-')
但这不是一个好主意 - 理清存储和生活后来通常变得容易多了!
but it's not a good idea - sort out the storage and life generally becomes a lot easier later on!
这篇关于我想改变日期格式“28 may 14”形式为“28-may-14”的形式使用sql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文