Re: String manipulation

From: Joe Conway <mail(at)joeconway(dot)com>
To: David Olbersen <DOlbersen(at)stbernard(dot)com>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: String manipulation
Date: 2003-07-28 22:55:08
Message-ID: 3F25A9CC.2050402@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

David Olbersen wrote:
> 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;
>

That solution was pretty much what I was thinking. An alternative:

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

Joe

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message David Olbersen 2003-07-28 23:08:42 Re: String manipulation
Previous Message Bryan Irvine 2003-07-28 22:02:59 auto-counting tables