li-ang-666 opened a new issue #4618: URL: https://github.com/apache/incubator-doris/issues/4618
timestampdiff(DAY,时间1,时间2) 判断 -1,0,1 ,2 .. 的依据,在MySQL中是24小时,在Doris中也是,但是某种情况下,出现的结果是错误的: 时间2 和 时间1 是同一天 && 时间2 小于 时间1 此时会直接被判定为-1 MySQL [bi_production]> select timestampdiff(DAY,'2020-02-02 11:11:11','2020-02-02 11:11:11'); +------------------------------------------------------------------+ | timestampdiff(DAY, '2020-02-02 11:11:11', '2020-02-02 11:11:11') | +------------------------------------------------------------------+ | 0 +------------------------------------------------------------------+ 1 row in set (0.01 sec) --正确 MySQL [bi_production]> select timestampdiff(DAY,'2020-02-02 11:11:11','2020-02-02 10:10:10'); +------------------------------------------------------------------+ | timestampdiff(DAY, '2020-02-02 11:11:11', '2020-02-02 10:10:10') | +------------------------------------------------------------------+ | -1 +------------------------------------------------------------------+ 1 row in set (0.00 sec) --错误,虽然时间小于,但是没有小于超过24小时 MySQL [bi_production]> select timestampdiff(DAY,'2020-02-02 11:11:11','2020-02-01 12:12:12'); +------------------------------------------------------------------+ | timestampdiff(DAY, '2020-02-02 11:11:11', '2020-02-01 12:12:12') | +------------------------------------------------------------------+ | 0 +------------------------------------------------------------------+ 1 row in set (0.01 sec) --正确,虽然时间小于,但是没有小于超过24小时 ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org