ClickHouse/tests/queries/0_stateless/02480_interval_casting_and_subquery.sql

26 lines
1.7 KiB
SQL

SELECT toIntervalSecond(5) AS interval, toDateTime('2017-01-01 00:00:00') + interval AS res;
SELECT toIntervalMinute(5) AS interval, toDateTime('2017-01-01 00:00:00') + interval AS res;
SELECT toIntervalHour(5) AS interval, toDateTime('2017-01-01 00:00:00') + interval AS res;
SELECT toIntervalDay(5) AS interval, toDateTime('2017-01-01 00:00:00') + interval AS res;
SELECT toIntervalMonth(5) AS interval, toDateTime('2017-01-01 00:00:00') + interval AS res;
SELECT toIntervalQuarter(5) AS interval, toDateTime('2017-01-01 00:00:00') + interval AS res;
SELECT toIntervalYear(5) AS interval, toDateTime('2017-01-01 00:00:00') + interval AS res;
SELECT CAST(5 AS IntervalNanosecond);
SELECT CAST(5 AS IntervalMicrosecond);
SELECT CAST(5 AS IntervalMillisecond);
SELECT CAST(5 AS IntervalSecond);
SELECT CAST(5 AS IntervalMinute);
SELECT CAST(5 AS IntervalHour);
SELECT CAST(5 AS IntervalDay);
SELECT CAST(5 AS IntervalWeek);
SELECT CAST(5 AS IntervalMonth);
SELECT CAST(5 AS IntervalQuarter);
SELECT CAST(5 AS IntervalYear);
SELECT (SELECT toIntervalSecond(5)) AS interval, toDateTime('2017-01-01 00:00:00') + interval AS res;
SELECT (SELECT toIntervalMinute(5)) AS interval, toDateTime('2017-01-01 00:00:00') + interval AS res;
SELECT (SELECT toIntervalHour(5)) AS interval, toDateTime('2017-01-01 00:00:00') + interval AS res;
SELECT (SELECT toIntervalDay(5)) AS interval, toDateTime('2017-01-01 00:00:00') + interval AS res;
SELECT (SELECT toIntervalMonth(5)) AS interval, toDateTime('2017-01-01 00:00:00') + interval AS res;
SELECT (SELECT toIntervalQuarter(5)) AS interval, toDateTime('2017-01-01 00:00:00') + interval AS res;
SELECT (SELECT toIntervalYear(5)) AS interval, toDateTime('2017-01-01 00:00:00') + interval AS res;