Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

Integer and Floating-Point Literals

Literals or constants that represent numbers can be integer or floating-point.

Integer Literals

An integer constant is a sequence of the digits 0-9, with an optional positive (+) or negative (-) sign preceding the digits.

Syntax

Copy
[ + | - ] digit ...

Examples

Valid integers include the following:

Copy
23 -555 +17

Floating-Point Literals

Floating-point literals (also referred to as decimal, numeric, or fractional literals) are sequences of digits that can include a decimal point, and optionally the exponent marker (e).

Syntax

Copy
[ + | - ] digit ... [ . ] [ digit ...] [ e | E [ + | - ] digit ... ]

Arguments

e | E

e or E indicates that the number is specified in scientific notation.

Examples

Valid floating-point literals include the following:

Copy
3.14159 -37. 2.0e19 -2E-19