String Manipulation

From: Christine Penner <christine(at)ingenioussoftware(dot)com>
To: Postgres-General <pgsql-general(at)postgresql(dot)org>
Subject: String Manipulation
Date: 2009-06-12 19:36:27
Message-ID: 19740414223344.8EDA1B01381CF54A@priv-edtnaa07.telusplanet.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I want to calculate a new field I added to a table but I'm not sure
how to do it. This will be a copy of another field with any non
numeric characters stripped off the end and padded with spaces.

This is what I was trying to do

Update Buildings SET B_LOT_SORT=lpad(substr(lot,1,??),7)

instead of ?? I need to know the position of the last numeric character.
Any suggestions would be appreciated

Christine Penner
Ingenious Software
250-352-9495
christine(at)ingenioussoftware(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Harald Fuchs 2009-06-12 20:14:21 Re: WITH RECURSIVE clause -- all full and partial paths
Previous Message Sam Mason 2009-06-12 18:38:44 Re: search for partial dates