Re: [SQL] handle the MONEY type - Mailing list pgsql-sql

From Jose' Soares Da Silva
Subject Re: [SQL] handle the MONEY type
Date
Msg-id Pine.LNX.3.96.980616150940.8937A-100000@proxy
Whole thread Raw
In response to handle the MONEY type  (Marcio Macedo <marciom@conectiva.com.br>)
List pgsql-sql
On Tue, 16 Jun 1998, Marcio Macedo wrote:

> Hi
>
> How can I handle the type money ? (if is exists), how can I make
> insertions and settings  ???
>
prova=> create table prova (dinheiro money);
CREATE
prova=> insert into prova values (12.50);
INSERT 202089 1
prova=> insert into prova values (10);
INSERT 202090 1
prova=> select * from prova;
dinheiro
--------
$12.50
$10.00
(2 rows)

prova=> select dinheiro+10.25 from prova;
?column?
--------
$22.75
$20.25
(2 rows)

prova=> select dinero / '1.1'::float from prova;
?column?
--------
$11.36
$9.09
(2 rows)

prova=> select dinero - 1.1 from prova;
?column?
--------
$11.40
$8.90
(2 rows)

prova=> select dinero * '1.1'::float from prova;
?column?
--------
$13.75
$11.00
(2 rows)
----
^  ^
OlhO: Be aware that currently isn't possible to CAST a money type to
another types.
                                                   Jose'

                               |  |
~~~~~~~~~~~~~~~~~~~~~~~~       |  |         ~~~~~~~~~~~~~~~~~~~~~~~~
          Progetto HYGEA   ----    ----     www.sferacarta.com
    Sfera Carta Software   ----    ----     sferac@bo.nettuno.it
       Via Bazzanese, 69       |  |         Fax. ++39 51 6131537
Casalecchio R.(BO) Italy       |  |         Tel. ++39 51  591054


pgsql-sql by date:

Previous
From: Marcio Macedo
Date:
Subject: handle the MONEY type
Next
From: calvin@improtech.co.za (Calvin Browne)
Date:
Subject: Beginner Join question