Re: float to int

From: Lew <lew(at)lwsc(dot)ehost-services(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: float to int
Date: 2007-11-12 19:54:37
Message-ID: 4oSdncE2-KHjMqXanZ2dnUVZ_ufinZ2d@comcast.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Edoardo Panfili wrote:
> Charles.Hou ha scritto:
>> how can i get the int value using the sql language? like this,
>>
>> "select cost from my_money_table " , the data type of cost is float.
>>
> take a look at
> http://www.postgresql.org/docs/8.2/static/sql-expressions.html
> CAST ( expression AS type )
> expression::type

Incidentally, float is about the worst data type to represent monetary amounts
that one can choose.

--
Lew

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lew 2007-11-12 19:58:01 Re: update record with two-column primary key
Previous Message Lew 2007-11-12 19:53:55 Re: md5() sorting