ClickHouse/tests/queries/0_stateless/01511_format_readable_timedelta.sql

20 lines
884 B
MySQL
Raw Normal View History

SELECT
arrayJoin([1, 60, 60*60, 60*60*24, 60*60*24*30, 60*60*24*365]) AS elapsed,
formatReadableTimeDelta(elapsed*5.5) AS time_delta;
SELECT
2020-10-11 15:32:03 +00:00
'minutes' AS maximum_unit,
arrayJoin([1, 60, 60*60, 60*60*24, 60*60*24*30, 60*60*24*365]) AS elapsed,
formatReadableTimeDelta(elapsed*5.5, maximum_unit) AS time_delta;
SELECT
2020-10-11 15:32:03 +00:00
'hours' AS maximum_unit,
arrayJoin([1, 60, 60*60, 60*60*24, 60*60*24*30, 60*60*24*365]) AS elapsed,
formatReadableTimeDelta(elapsed*5.5, maximum_unit) AS time_delta;
SELECT
2020-10-11 15:32:03 +00:00
'days' AS maximum_unit,
arrayJoin([1, 60, 60*60, 60*60*24, 60*60*24*30, 60*60*24*365]) AS elapsed,
formatReadableTimeDelta(elapsed*5.5, maximum_unit) AS time_delta;
SELECT
2020-10-11 15:32:03 +00:00
'months' AS maximum_unit,
arrayJoin([1, 60, 60*60, 60*60*24, 60*60*24*30, 60*60*24*365]) AS elapsed,
formatReadableTimeDelta(elapsed*5.5, maximum_unit) AS time_delta;