在 PostgreSQL 中将 YYY-MM-DD 转换为 MON DD, YYYY
我在将列中的日期从 YYYY-MM-DD 转换为 Mon DD, YYYY 时遇到困难,
我想我首先需要重新组织日期,然后使用 case when 语句指定 01 = Jan 等?这是正确的吗?
SELECT to_date(column_name, 'MM/DD/YYYY')
FROM table
给了我一些不正确的日期 即之前 = 2012-01-29 和 查询结果 = 0197-06-26
有什么建议吗?谢谢
I am having difficulty converting dates in a column from YYYY-MM-DD to Mon DD, YYYY
I think I first need to reorganize the dates and then use a case when statement to specify 01 = Jan and so on? Is that correct?
SELECT to_date(column_name, 'MM/DD/YYYY')
FROM table
gives me some incorrect dates
i.e. previous = 2012-01-29 and
result from query = 0197-06-26
Any suggestions? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想通了!
给了我我所需要的东西,而不需要案例陈述。
I figured it out!
gives me exactly what I need without the need of a case statement.