Re: String manipulation

From: "David Olbersen" <DOlbersen(at)stbernard(dot)com>
To: "pgsql-novice" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: String manipulation
Date: 2003-07-28 21:18:56
Message-ID: E7E213858379814A9AE48CA6754F5ECB0D7021@mail01.stbernard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Chad,

I have an *UGLY* solution that might give you or others some ideas...

SELECT
substring(
split_part( path, ':', 2 )
from
position( ' ' in split_part( path, ':', 2 ) ) + 1
)
FROM paths;

--------------------------
David Olbersen
iGuard Engineer
St. Bernard Software
11415 West Bernardo Court
San Diego, CA 92127
1-858-676-2277 x2152

> -----Original Message-----
> From: Chad Thompson [mailto:chad(at)weblinkservices(dot)com]
> Sent: Monday, July 28, 2003 1:56 PM
> To: pgsql-novice
> Subject: [NOVICE] String manipulation
>
>
> I cannot seem to put this together properly.
>
> I have a column path that has string data I want parsed out.
>
> select path from paths
>
> path
> -------------------------------------
> Canon:Canon Toner
> Data Products:Data Products Toner
> Epson:Epson Inkjet Cartridges
> Tektronix by Xerox:Tektronix Ink Sticks
>
>
> what i would like is something like this
>
> Toner
> Products Toner
> Inkjet Cartridges
> Ink Sticks
>
> That is.... after the colon, find the first space and give
> the rest of the
> string.
>
> TIA for any ideas
> Chad
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
> majordomo(at)postgresql(dot)org
>

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bryan Irvine 2003-07-28 22:02:59 auto-counting tables
Previous Message Chad Thompson 2003-07-28 20:56:13 String manipulation