diff --git a/docs/sql-ref-literals.md b/docs/sql-ref-literals.md index b23c63a98e..355ac69cef 100644 --- a/docs/sql-ref-literals.md +++ b/docs/sql-ref-literals.md @@ -439,13 +439,78 @@ SELECT TIMESTAMP '1997-01' AS col; An interval literal is used to specify a fixed period of time. +#### ANSI style + +The ANSI SQL standard defines interval literals in the form: +```sql +INTERVAL [ ] +``` +where `` can be a single field or in the field-to-field form: +```sql + ::= TO | +``` +The field name is case-insensitive, and can be one of `YEAR`, `MONTH`, `DAY`, `HOUR`, `MINUTE` and `SECOND`. + +An interval literal can have either year-month or day-time interval type. The interval sub-type defines format of ``: +```sql + ::= [ ] { | } + ::= [ ] | + ::= |