ClickHouse/tests/queries/0_stateless/00524_time_intervals_months_underflow.sql
Ivan 97f2a2213e
Move all folders inside /dbms one level up (#9974)
* Move some code outside dbms/src folder
* Fix paths
2020-04-02 02:51:21 +03:00

61 lines
3.2 KiB
SQL

SELECT toDateTime('2017-01-01 00:00:00') + INTERVAL 0 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') + INTERVAL 1 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') + INTERVAL 11 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') + INTERVAL 12 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') + INTERVAL 13 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') + INTERVAL -1 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') + INTERVAL -11 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') + INTERVAL -12 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') + INTERVAL -13 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') - INTERVAL 0 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') - INTERVAL 1 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') - INTERVAL 11 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') - INTERVAL 12 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') - INTERVAL 13 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') - INTERVAL -1 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') - INTERVAL -11 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') - INTERVAL -12 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') - INTERVAL -13 MONTH AS x;
SELECT toDate('2017-01-01') + INTERVAL 0 MONTH AS x;
SELECT toDate('2017-01-01') + INTERVAL 1 MONTH AS x;
SELECT toDate('2017-01-01') + INTERVAL 11 MONTH AS x;
SELECT toDate('2017-01-01') + INTERVAL 12 MONTH AS x;
SELECT toDate('2017-01-01') + INTERVAL 13 MONTH AS x;
SELECT toDate('2017-01-01') + INTERVAL -1 MONTH AS x;
SELECT toDate('2017-01-01') + INTERVAL -11 MONTH AS x;
SELECT toDate('2017-01-01') + INTERVAL -12 MONTH AS x;
SELECT toDate('2017-01-01') + INTERVAL -13 MONTH AS x;
SELECT toDate('2017-01-01') - INTERVAL 0 MONTH AS x;
SELECT toDate('2017-01-01') - INTERVAL 1 MONTH AS x;
SELECT toDate('2017-01-01') - INTERVAL 11 MONTH AS x;
SELECT toDate('2017-01-01') - INTERVAL 12 MONTH AS x;
SELECT toDate('2017-01-01') - INTERVAL 13 MONTH AS x;
SELECT toDate('2017-01-01') - INTERVAL -1 MONTH AS x;
SELECT toDate('2017-01-01') - INTERVAL -11 MONTH AS x;
SELECT toDate('2017-01-01') - INTERVAL -12 MONTH AS x;
SELECT toDate('2017-01-01') - INTERVAL -13 MONTH AS x;
SELECT toDateTime('2017-01-01 00:00:00') + INTERVAL 0 YEAR AS x;
SELECT toDateTime('2017-01-01 00:00:00') + INTERVAL 1 YEAR AS x;
SELECT toDateTime('2017-01-01 00:00:00') + INTERVAL -1 YEAR AS x;
SELECT toDateTime('2017-01-01 00:00:00') - INTERVAL 0 YEAR AS x;
SELECT toDateTime('2017-01-01 00:00:00') - INTERVAL 1 YEAR AS x;
SELECT toDateTime('2017-01-01 00:00:00') - INTERVAL -1 YEAR AS x;
SELECT toDate('2017-01-01') + INTERVAL 0 YEAR AS x;
SELECT toDate('2017-01-01') + INTERVAL 1 YEAR AS x;
SELECT toDate('2017-01-01') + INTERVAL -1 YEAR AS x;
SELECT toDate('2017-01-01') - INTERVAL 0 YEAR AS x;
SELECT toDate('2017-01-01') - INTERVAL 1 YEAR AS x;
SELECT toDate('2017-01-01') - INTERVAL -1 YEAR AS x;
SELECT toDate('2017-01-01') + INTERVAL number - 15 MONTH AS x FROM system.numbers LIMIT 30;
SELECT toDate('2017-01-01') - INTERVAL number - 15 MONTH AS x FROM system.numbers LIMIT 30;
SELECT toDate('2017-01-01') + INTERVAL number - 15 YEAR AS x FROM system.numbers LIMIT 30;
SELECT toDate('2017-01-01') - INTERVAL number - 15 YEAR AS x FROM system.numbers LIMIT 30;