Re: how to count string occurrence in column

Поиск
Список
Период
Сортировка
От Jules Alberts
Тема Re: how to count string occurrence in column
Дата
Msg-id 200208270952.g7R9q9SO028562@artemis.cuci.nl
обсуждение исходный текст
Ответ на Re: how to count string occurrence in column  (Lee Kindness <lkindness@csl.co.uk>)
Список pgsql-general
On 27 Aug 2002 at 10:35, Lee Kindness wrote:
> Actually i'm sure the original poster is after something like:
>
>  SELECT count('qwerty qwert qwertyffff fff qq', 'qwerty');
>   count
>  --------
>        2
>  (1 row)
>
> But off the top of my head i cannot think of a suitable standard
> function...

Woops, posted too quick. Maybe my posting doesn't answer the original
question:

                column1
row 1   'test test'
row 2   'test'

My statement would count 2. Maybe the OP would want 3. In that case, I
think you'll have to write some code that counts substring occurences.

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

Предыдущее
От: "Jules Alberts"
Дата:
Сообщение: Re: how to count string occurrence in column
Следующее
От: "Nigel J. Andrews"
Дата:
Сообщение: Re: union and limit