Search Postgresql Archives

Re: [SQL] How to convert string to integer

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

 





On Wed, Dec 15, 2010 at 11:23 AM, venkat <ven.tammineni@xxxxxxxxx> wrote:
Dear All,

ÂÂHow do i convert string to intÂ

select SUM(pan_1) from customers1 where name='101'

When i run the above query i m getting Â"function sum(character varying) does not exist"..

Please anyone can guide me..

Thanks



select SUM(pan_1::integer) from customers1 where name='101'

also you can use conversion functions described here
http://www.postgresql.org/docs/8.2/static/functions-formatting.html

--
---------------------------------------
Viktor BojoviÄ
---------------------------------------
Wherever I go, Murphy goes with me

[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