Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions _data/sidebar_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ entries:
- title: Keywords & Identifiers
url: /keywords-and-identifiers.html

- title: Constants
url: /sql-constants.html

- title: Indexes
url: /indexes.html

Expand Down Expand Up @@ -304,6 +307,15 @@ entries:
- title: <code>BYTES</code>
url: /bytes.html

- title: Expressions
thirdlevelitems:

- title: Value Expressions
url: /sql-expressions.html

- title: Table Expressions
url: /table-expressions.html

- title: Privileges
url: /privileges.html

Expand Down
38 changes: 19 additions & 19 deletions sql-constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,22 @@ values equivalent to the `'aaa'` string literal.
Numeric literals can have the following forms:

~~~
[+-]9999
[+-]9999.[9999][e[+-]999]
[+-][9999].9999[e[+-]999]
[+-]9999e[+-]999
[+-]0xAAAA
[+-]9999
[+-]9999.[9999][e[+-]999]
[+-][9999].9999[e[+-]999]
[+-]9999e[+-]999
[+-]0xAAAA
~~~

Some examples:

~~~
+4269
3.1415
-.001
6.626e-34
50e6
0xcafe111
+4269
3.1415
-.001
6.626e-34
50e6
0xcafe111
~~~

The actual data type of a numeric constant depends both on the context
Expand Down Expand Up @@ -193,8 +193,8 @@ This feature is inspired from MySQL.
A constant of any data type can be formed using either of the following formats:

~~~
type 'string'
'string':::type
type 'string'
'string':::type
~~~

The value of the string part is used as input for the conversion function to the
Expand All @@ -203,11 +203,11 @@ specified data type, and the result is used as a constant with that data type.
Examples:

~~~
DATE '2013-12-23'
BOOL 'FALSE'
'42.69':::INT
'TRUE':::BOOL
'3 days':::INTERVAL
DATE '2013-12-23'
BOOL 'FALSE'
'42.69':::INT
'TRUE':::BOOL
'3 days':::INTERVAL
~~~

Additionally, for compatibility with PostgreSQL, the notation
Expand All @@ -232,5 +232,5 @@ type during expression evaluation is determined based on context.

## See Also

- [Expressions](sql-expressions.html)
- [Value Expressions](sql-expressions.html)
- [Data Types](data-types.html)
Loading