更新时间:2024-11-15 GMT+08:00
INTERVAL
MySQL中使用interval表达式格式为INTERVAL N时间单位,DWS不支持,需要转换为INTERVAL 'N'时间单位。
输入示例
1 2 3 4 5 6 |
SELECT CURRENT_TIME() - INTERVAL 4 DAY; SELECT NOW() - INTERVAL 5 HOUR; SELECT CURRENT_TIME() - INTERVAL '4' DAY; SELECT NOW() - INTERVAL '5' HOUR; SELECT CURRENT_TIME() - INTERVAL "4" DAY; SELECT NOW() - INTERVAL "5" HOUR; |
输出示例
1 2 3 4 5 6 |
SELECT (CURRENT_TIME () - INTERVAL '4' DAY); SELECT (NOW () - INTERVAL '5' HOUR); SELECT (CURRENT_TIME () - INTERVAL '4' DAY); SELECT (NOW () - INTERVAL '5' HOUR); SELECT (CURRENT_TIME () - INTERVAL '4' DAY); SELECT (NOW () - INTERVAL '5' HOUR); |
父主题: 数据操作语句(DML)