[英]Using MONTHNAME and DATE_FORMAT together
I'm retrieving and storing a Date field from a database.我正在从数据库中检索和存储日期字段。 On the graph I want to print only the "day of month" with month_name在图表上,我只想用 month_name 打印“月份中的某天”
DATE_FORMAT and MONTHNAME does the job, but not together. DATE_FORMAT 和 MONTHNAME 可以完成这项工作,但不能一起完成。 Any alternatives for the problem?该问题的任何替代方案?
INPUT: 2015-02-20 00:00:10
OUTPUT: 20th Feb
Since you're mentioning Oracle:既然你提到了甲骨文:
SELECT TO_CHAR(to_timestamp('2015-02-20 00:00:10','YYYY-MM-DD HH24:MI:SS'),'ddth Mon')
FROM dual
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.