DECIMAL_SCALE function - Amazon Redshift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

DECIMAL_SCALE function

Checks the number of decimal digits to be stored to the right of the decimal point. The range of the scale is from 0 to the precision point, with a default of 0.

Syntax

DECIMAL_SCALE(super_expression)

Arguments

super_expression

A SUPER expression or column.

Return type

INTEGER

Examples

To apply the DECIMAL_SCALE function to the table t, use the following example.

CREATE TABLE t(s SUPER); INSERT INTO t VALUES (3.14159); SELECT DECIMAL_SCALE(s) FROM t; +---------------+ | decimal_scale | +---------------+ | 5 | +---------------+