Re: [SQL] handle the MONEY type

From: "Jose' Soares Da Silva" <sferac(at)bo(dot)nettuno(dot)it>
To: Marcio Macedo <marciom(at)conectiva(dot)com(dot)br>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] handle the MONEY type
Date: 1998-06-16 15:24:47
Message-ID: Pine.LNX.3.96.980616150940.8937A-100000@proxy
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)bo(dot)nettuno(dot)it
Via Bazzanese, 69 | | Fax. ++39 51 6131537
Casalecchio R.(BO) Italy | | Tel. ++39 51 591054

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Herouth Maoz 1998-06-16 15:47:25 Re: [SQL] Beginner Join question
Previous Message Calvin Browne 1998-06-16 15:17:54 Beginner Join question