[英]How to convert Date November 8 2019 to 11/08/19
您能否让我知道如何在 Oracle SQL 语句中将 2019 年 11 月 8 日转换为 11/08/19
The Oracle DATE
type is stored internally as a numeric value (not to be confused with the NUMBER
type). Oracle DATE
类型在内部存储为数值(不要与NUMBER
类型混淆)。 Consequently, an Oracle DATE
has no format and it does not make sense to talk about converting a DATE
from one format to another.因此,Oracle DATE
没有格式,谈论将DATE
从一种格式转换为另一种格式是没有意义的。
So, what you are asking about is how to convert a string representation of a particular date from one format to another.因此,您要问的是如何将特定日期的字符串表示形式从一种格式转换为另一种格式。 The answer is to first convert the input string to a DATE
using the input string's format and then convert the resulting DATE
back to a string using the desired output format.答案是第一转换输入字符串到DATE
使用输入字符串的格式,然后将转换所得DATE
使用希望的输出格式回字符串。
Like this:像这样:
select to_char(to_date('November 8 2019','MONTH DD YYYY'),'MM/DD/YY') from dual;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.