Search Postgresql Archives

Re: postgres function

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

 



On Thu, Oct 15, 2015 at 8:32 AM, Ramesh T <rameshparnanditech@xxxxxxxxx> wrote:
 select position('-' in '123-987-123')
position
---
4
But I want second occurrence,
position
-------------
8

plz any help..?

 
SELECT length((regexp_matches('123-987-123', '(\d{3}-\d{3}-)\d{3}'))[1])

David J.


[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