IFNULL返回结果不合预期

Viewed 32

doris version: 2.1.6

sql1:
select time_to_sec(cast('2024-09-24 16:00:00' as varchar));
-- 57600

sql2:
select sec_to_time(57600);
-- 04:00:00 PM

sql3:
select sec_to_time(time_to_sec(cast('2024-09-24 16:00:00' as varchar)));
-- 04:00:00 PM

sql4:
select ifnull(sec_to_time(time_to_sec(cast('2024-09-24 16:00:00' as varchar))), 111111);
-- 57600000000

预想查询结果sql1和sql4应该是一致的,但是sql4的结果多6个数量级。

1 Answers