presentations/highlight-js/test/markup/sql/interval.txt

18 lines
484 B
Text
Raw Normal View History

2018-12-07 08:48:05 -06:00
SELECT
CURRENT_TIMESTAMP
- INTERVAL 2 YEARS
+ INTERVAL 1 MONTH
- INTERVAL 3 DAYS
+ INTERVAL 10 HOURS
+ interval 30 MINUTES
- INTERVAL 20 SECOND AS past_timestamp
FROM VALUES ("dummy");
WITH ts AS (
SELECT CURRENT_TIMESTAMP AS now FROM VALUES ('dummy')
)
SELECT
now - INTERVAL 1 DAY - INTERVAL 2 HOURS - INTERVAL 3 MINUTES - INTERVAL 4 SECONDS AS LONG_VERSION,
now - INTERVAL '1 2:3:4.100' DAY TO SECOND AS SHORT_VERSION
FROM ts;