Zkplo opened a new issue, #11152:
URL: https://github.com/apache/inlong/issues/11152

   ### Description
   
   - parent issue #10796 
   - MySql Official Description: 
https://dev.mysql.com/doc/refman/8.4/en/date-and-time-functions.html#function_timestampdiff
   
   TIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2): Returns datetime_expr2 − 
datetime_expr1, where datetime_expr1 and datetime_expr2 are date or datetime 
expressions. One expression may be a date and the other a datetime; a date 
value is treated as a datetime having the time part '00:00:00' where necessary. 
 This function returns NULL if datetime_expr1 or datetime_expr2 is NULL.
   > The unit parameter should be one of the following values: FRAC_SECOND, 
SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or YEAR.
   
   ### Use case
   
   ```sql
   TIMESTAMPDIFF(MONTH,'2003-02-01','2003-05-01'); -> 3
   TIMESTAMPDIFF(YEAR,'2002-05-01','2001-01-01'); -> -1
   TIMESTAMPDIFF(MINUTE,'2003-02-01','2003-05-01 12:05:55');  -> 128885
   TIMESTAMPDIFF(MINUTE,null,'2003-05-01 12:05:55');  -> null
   ```
   
   ### Are you willing to submit PR?
   
   - [X] Yes, I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to