Number-Type Literals

Vertica supports three types of numbers: integers, numerics, and floats.

Numeric-type values can also be generated using casts from character strings. This is a more general syntax. See the Examples section below, as well as Data Type Coercion Operators (CAST).

Syntax

digits 
digits.[digits] | [digits].digits
digits e[+-]digits | [digits].digits e[+-]digits | digits.[digits] e[+-]digits

Parameters

digits One or more numeric characters, 0 through 9
e Exponent marker

Notes

Examples

The following are examples of number-type literals:

42
3.5
4.
.001
5e2
1.925e-3

Scientific notation:

=> SELECT NUMERIC '1e10';  
 ?column?
-------------
 10000000000
(1 row)

BINARY scaling:

=> SELECT NUMERIC '1p10'; 
 ?column?
----------
     1024
(1 row)
=> SELECT FLOAT 'Infinity';
  ?column?
----------
 Infinity
(1 row)

The following examples illustrated using the / and // operators to divide integers:

=> SELECT 40/25;       
 ?column?
----------------------
 1.600000000000000000
(1 row)
=> SELECT 40//25;
 ?column?
----------
        1
(1 row)

See Also

Data Type Coercion