Search Postgresql Archives

Re: postgres function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux