Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
然而,这可能是一个愚蠢的问题。我有这两个选择:第一个返回结果,而第二个给我一个无效的月份错误。我似乎无法弄清楚为什么..
select to_date('09-12-14','dd-mm-rr') - to_date('01/january/2007') from dual; select to_date('09-12-14','dd-mm-rr') - to_date('01-01-2007') from dual;
提前 Tnx
当您不指定格式掩码时,Oracle 将使用该NLS_DATE_FORMAT设置(和一些预定义的掩码)来确定日期时间格式掩码。
NLS_DATE_FORMAT
显然您的服务器设置支持第一种格式,而不是第二种格式。因此,最好始终指定您的格式掩码。