mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-05 22:12:21 +00:00
a901faeb84
Signed-off-by: sperlingxx <lovedreamf@gmail.com>
71 lines
3.8 KiB
SQL
71 lines
3.8 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 INTERVAL number - 15 MONTH + toDate('2017-01-01') AS x FROM system.numbers LIMIT 30;
|
|
SELECT toDate('2017-01-01') - INTERVAL number - 15 MONTH AS x FROM system.numbers LIMIT 30;
|
|
|
|
SELECT INTERVAL number - 15 YEAR + toDate('2017-01-01') AS x FROM system.numbers LIMIT 30;
|
|
SELECT toDate('2017-01-01') - INTERVAL number - 15 YEAR AS x FROM system.numbers LIMIT 30;
|
|
|
|
|
|
SELECT toDate32('2217-01-01') + INTERVAL number * 20 - 100 DAY AS x FROM system.numbers LIMIT 10;
|
|
SELECT INTERVAL 100 - number * 20 DAY + toDate32('2217-01-01') AS x FROM system.numbers LIMIT 10;
|
|
|
|
SELECT INTERVAL number * 4 - 20 MONTH + toDate32('2217-01-01') AS x FROM system.numbers LIMIT 10;
|
|
SELECT toDate32('2217-01-01') - INTERVAL number * 4 - 20 MONTH AS x FROM system.numbers LIMIT 10;
|
|
|
|
SELECT INTERVAL number * 4 - 20 YEAR + toDate32('2217-01-01') AS x FROM system.numbers LIMIT 10;
|
|
SELECT toDate32('2217-01-01') - INTERVAL number * 4 - 20 YEAR AS x FROM system.numbers LIMIT 10;
|