pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
handle the MONEY type
2+ messages / 2 participants
[nested] [flat]

* handle the MONEY type
@ 1998-06-16 09:07  Marcio Macedo <marciom@conectiva.com.br>
  0 siblings, 1 reply; 2+ messages in thread

From: Marcio Macedo @ 1998-06-16 09:07 UTC (permalink / raw)
  To: pgsql-sql

Hi

How can I handle the type money ? (if is exists), how can I make
insertions and settings  ???




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [SQL] handle the MONEY type
@ 1998-06-16 15:24  Jose' Soares Da Silva <sferac@bo.nettuno.it>
  parent: Marcio Macedo <marciom@conectiva.com.br>
  0 siblings, 0 replies; 2+ messages in thread

From: Jose' Soares Da Silva @ 1998-06-16 15:24 UTC (permalink / raw)
  To: Marcio Macedo <marciom@conectiva.com.br>; +Cc: 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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1998-06-16 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-06-16 09:07 handle the MONEY type Marcio Macedo <marciom@conectiva.com.br>
1998-06-16 15:24 ` Jose' Soares Da Silva <sferac@bo.nettuno.it>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox