String function to Find how many times str2 is in str1?

Поиск
Список
Период
Сортировка
От Emi Lu
Тема String function to Find how many times str2 is in str1?
Дата
Msg-id 47B5B944.4010203@encs.concordia.ca
обсуждение исходный текст
Ответы Re: String function to Find how many times str2 is in str1?  ("Rodrigo E. De León Plicet" <rdeleonp@gmail.com>)
Список pgsql-sql
Good morning,

Is there a string function in PSQL to count how many times one str is in 
another string?

For example,
Str1 = "test   test   caa   dtest   testing   EndofString";
Str2 = "   ";

select funcName(Str1, Str2);

return 5

Because Str1 has 5 Str2.

Thanks !
Ly




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

Предыдущее
От: "Bart Degryse"
Дата:
Сообщение: Re: Function description
Следующее
От: "Rodrigo E. De León Plicet"
Дата:
Сообщение: Re: String function to Find how many times str2 is in str1?