mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-06 14:32:22 +00:00
30 lines
1.5 KiB
SQL
30 lines
1.5 KiB
SQL
SET session_timezone = 'UTC';
|
|
|
|
SELECT ADDDATE(materialize('2022-05-07'::Date), INTERVAL 5 MINUTE);
|
|
|
|
SELECT addDate('2022-05-07'::Date, INTERVAL 5 MINUTE);
|
|
SELECT addDate('2022-05-07'::Date32, INTERVAL 5 MINUTE);
|
|
SELECT addDate('2022-05-07'::DateTime, INTERVAL 5 MINUTE);
|
|
SELECT addDate('2022-05-07'::DateTime64, INTERVAL 5 MINUTE);
|
|
SELECT addDate('2022-05-07', INTERVAL 5 MINUTE);
|
|
|
|
SELECT addDate('2022-05-07'::Date); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }
|
|
SELECT addDate('2022-05-07'::Date, INTERVAL 5 MINUTE, 5); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }
|
|
SELECT addDate('2022-05-07'::Date, 10); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
|
SELECT addDate(1.2, INTERVAL 5 MINUTE); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
|
|
|
SELECT '---';
|
|
|
|
SELECT SUBDATE(materialize('2022-05-07'::Date), INTERVAL 5 MINUTE);
|
|
|
|
SELECT subDate('2022-05-07'::Date, INTERVAL 5 MINUTE);
|
|
SELECT subDate('2022-05-07'::Date32, INTERVAL 5 MINUTE);
|
|
SELECT subDate('2022-05-07'::DateTime, INTERVAL 5 MINUTE);
|
|
SELECT subDate('2022-05-07'::DateTime64, INTERVAL 5 MINUTE);
|
|
SELECT subDate('2022-05-07'::String, INTERVAL 5 MINUTE);
|
|
|
|
SELECT subDate('2022-05-07'::Date); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }
|
|
SELECT subDate('2022-05-07'::Date, INTERVAL 5 MINUTE, 5); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }
|
|
SELECT subDate('2022-05-07'::Date, 10); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
|
SELECT subDate(1.2, INTERVAL 5 MINUTE); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|