Re: substr_count

Поиск
Список
Период
Сортировка
От scott.marlowe
Тема Re: substr_count
Дата
Msg-id Pine.LNX.4.33.0307100936220.10734-100000@css120.ihs.com
обсуждение исходный текст
Ответ на substr_count  (Tom Rochester <tomr@chu.com.au>)
Список pgsql-sql
On Thu, 10 Jul 2003, Tom Rochester wrote:

> Hey all,
> 
> I would like to achive something along the lines of:
> 
> SELECT field FROM table WHERE field ILIKE '$searchterm' ORDER BY 
> substr_count(field, '$searchterm');
> 
> Of course the substr_count function does not exist. Is there anyway to 
> do this?
> 
> I had a thought char_count(replace(field, !$searchterm, '')) might do 
> the job but replace doesn't allow for 'replace everything NOT string';

You'll likely have to code a bit in pl/pgsql.  The regex capable substring 
of 7.3 might come in handy.



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

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: max length of sql select statement ?
Следующее
От: "scott.marlowe"
Дата:
Сообщение: Re: trigger proceedures in sql