A numeric alternative to money : numeric « Data Type « PostgreSQL






A numeric alternative to money


postgres=#
postgres=# -- A numeric alternative to money
postgres=#
postgres=# CREATE TABLE money_example (
postgres(#             money_cash money,
postgres(#             numeric_cash numeric(10,2));
CREATE TABLE
postgres=#
postgres=# INSERT INTO money_example VALUES ('$12.24', 12.24);
INSERT 0 1
postgres=#
postgres=# SELECT * FROM money_example;
 money_cash | numeric_cash
------------+--------------
     $12.24 |        12.24
(1 row)

postgres=#
postgres=#
postgres=# drop table money_example;
DROP TABLE
postgres=#
           
       








Related examples in the same category

1.Use numeric column