Answers for "decimal(10 2) in sql"

SQL
0

sql decimal to 2 places

CAST(MyNumber AS NUMERIC(18,2))
Posted by: Guest on March-22-2021
5

sql decimal(18 0)

-- DECIMAL(p,s)     p: number of digits (lkeft+right)  s: number of digits (right)
-- NUMERIC and DECIMAL are synonyms
CREATE TABLE test.sql_decimal (
    dec_col DECIMAL (4, 2)		-- Max total 4 digits, including 2 after decimal
);
INSERT INTO test.sql_decimal (dec_col) VALUES (10.05);		-- OK 4 digits
INSERT INTO test.sql_decimal (dec_col) VALUES (21.0425);	-- KO
Posted by: Guest on July-08-2021
0

2 decimal places sql.

SELECT ROUND(135.375, 2);
Posted by: Guest on August-11-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language