Re: varchar => int

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Mitch Vincent <mitch(at)venux(dot)net>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: varchar => int
Date: 2001-01-27 23:49:10
Message-ID: Pine.LNX.4.30.0101280048140.1492-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mitch Vincent writes:

> I can't cast varchar to int (according to the error I'm getting..), any
> ideas on how I can accomplish a ranged search on a varchar field (taking
> into acount the value of the numbers, not the character's ascii code)?

Try casting it to text first:

cast(cast(value as text) as integer)

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rob Arnold 2001-01-28 00:09:23 Re: MS Excel to PostgreSQL?
Previous Message Tom Lane 2001-01-27 23:47:29 Re: someone please explain this regex behaviour