📜  oracle sql 冬季时间更改 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:30.091000             🧑  作者: Mango

代码示例1
ALTER SESSION SET NLS_LANGUAGE=english; -- First day of week
SELECT 
    NEXT_DAY(LAST_DAY(TO_DATE(TO_CHAR('01/10/' -- Last Sunday of October 02:00
        || (EXTRACT(YEAR FROM SYSDATE)-5 + level) || '02:00:00'), 
           'DD/MM/YYYY HH24:MI:SS')) - INTERVAL '7' DAY, 'SUNDAY') AS H_WINTER,
    NEXT_DAY(LAST_DAY(TO_DATE(TO_CHAR('01/03/' -- Last Sunday of March 02:00 
        || (EXTRACT(YEAR FROM SYSDATE)-5 + level) || '02:00:00'),
        'DD/MM/YYYY HH24:MI:SS')) - INTERVAL '7' DAY, 'SUNDAY') AS H_SUMMER
FROM DUAL CONNECT BY level <=10;
-- ⇓ Test it ⇓ (Fiddle source link)