Использование типа numeric вместо money
Листинг 3.23. Использование типа numeric вместо money
booktown=# CREATE TABLE money_example (money_cash money.
booktown(# numeric_cash numeric(10,2)):
CREATE
booktown=# INSERT INTO money_example VALUES C$12.241, 12.24);
INSERT 3391095 1
booktown=# SELECT * FROM money_example;
money_cash | numeric_cash
$12.24 | 12.24 (1 row)
booktown=# SELECT money_cash,
booktown-# '$' | ltrim(to_char(numenc_cash. '9999.99'))
booktown-# AS numeric_cashif1ed
booktown-# FROM money_example;
money_cash | numeric_cashified
$12.24 j 12.24
(1 row)