Looking for sql Answers? Try Ask4KnowledgeBase
Looking for sql Keywords? Try Ask4Keywords

SQL DECIMAL and NUMERIC


Example

Fixed precision and scale decimal numbers. DECIMAL and NUMERIC are functionally equivalent.

Syntax:

DECIMAL ( precision [ , scale] )
NUMERIC ( precision [ , scale] )

Examples:

SELECT CAST(123 AS DECIMAL(5,2)) --returns 123.00
SELECT CAST(12345.12 AS NUMERIC(10,5)) --returns 12345.12000