Skip to content
Closed
Changes from 1 commit
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
27 changes: 21 additions & 6 deletions docs/sql-ref-literals.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,15 +275,30 @@ E [ + | - ] digit [ ... ]

Case insensitive, indicates `DECIMAL`, with the total number of digits as precision and the number of digits to right of decimal point as scale.

* **default (no postfix, no exponent)**

Indicates `DECIMAL`, same as the `BD` postfix.

* **default (no postfix, with exponent)**

Indicates `DOUBLE`, same as the `D` postfix.

#### Fractional Literals Examples

```sql
SELECT 12.578 AS col;
+------+
| col|
+------+
|12.578|
+------+
SELECT 12.578 AS col, TYPEOF(12.578) AS type;
+------+------------+
| col| type|
+------+------------+
|12.578|decimal(5,3)|
+------+------------+

SELECT 12.578E0 AS col, TYPEOF(12.578E0) AS type;
+------+------+
| col| type|
+------+------+
|12.578|double|
+------+------+

SELECT -0.1234567 AS col;
+----------+
Expand Down