Re: postgres function

From: Torsten Förtsch <torsten(dot)foertsch(at)gmx(dot)net>
To: Ramesh T <rameshparnanditech(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: postgres function
Date: 2015-10-15 21:08:13
Message-ID: 562015BD.3060800@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 15/10/15 14:32, Ramesh T wrote:
> select position('-' in '123-987-123')
> position
> ---
> 4
> But I want second occurrence,
> position
> -------------
> 8
>
> plz any help..?

For instance:

# select char_length(substring('123-987-123' from '^[^-]*-[^-]*-'));
char_length
-------------
8

Best,
Torsten

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Louis Battuello 2015-10-15 22:03:36 Standby pg_dump Conflict with Recovery
Previous Message Adrian Klaver 2015-10-15 21:05:42 Re: question