Search Postgresql Archives

Re: Cast char to number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In response to Christine Penner <christine@xxxxxxxxxxxxxxxxxxxxx>:

> I have a character field I want to change to a number. The values in 
> that field are all numbers that may or may not be padded with spaces 
> or 0's. What is the best way to do that?

Put the values in numeric fields to begin with and cast to chars as
needed.  Basically reverse what you're doing.

-- 
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux