Help Center/
Data Warehouse Service /
More Documents/
Tool Guide (Kuala Lumpur Region)/
DSC/
Migrating MySQL Syntax/
Data Manipulation Language (DML)/
INTERVAL
Updated on 2025-10-14 GMT+08:00
INTERVAL
In MySQL, the interval expression format is INTERVAL N, which is not supported by DWS and needs to be converted to INTERVAL'N'.
Input
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; |
Output
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); |
Parent topic: Data Manipulation Language (DML)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot