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.
我有一个输入日期(比如 sysdate),我想获取上周一的日期。我试过了
select trunc(sysdate, 'D') from dual;
但它依赖于 NLS。此外,我不想按名称检查结果,因为它可能会因我的代码运行所在国家/地区的语言而异。
尝试使用 ISO 周
SELECT TRUNC(SYSDATE, 'IW') - 7 previous_monday FROM dual
这是SQLFiddle演示