How to find the position of a characted in a string

Поиск
Список
Период
Сортировка
От ss_postgres
Тема How to find the position of a characted in a string
Дата
Msg-id 6c1264780812072230v6d89cbf4hf618c035d98319b4@mail.gmail.com
обсуждение исходный текст
Ответы Re: How to find the position of a characted in a string  ("Pawel Socha" <pawel.socha@gmail.com>)
Список pgsql-admin
Hi,

I am trying to find the position of a character in a string which appears multiple times.

The POSITION function returns the position of the character when it first occurs.

For eg:

select position ( ' ' in 'Hi How are you');

This returns the result as "3".


But i need to result to be

3
7
11


Can anyone please let me know what would be the best way to do this.
 
Thanks
 

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: upgrade via rpm
Следующее
От: "Pawel Socha"
Дата:
Сообщение: Re: How to find the position of a characted in a string