Re: substr_count - Mailing list pgsql-sql

From Rajesh Kumar Mallah
Subject Re: substr_count
Date
Msg-id 200307111523.16115.mallah@trade-india.com
Whole thread Raw
In response to substr_count  (Tom Rochester <tomr@chu.com.au>)
List pgsql-sql
On Thursday 10 Jul 2003 10:08 am, 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');
>


Hi In case you are  attempting to search text in a feild 
and sort it by relevence then contrib/tsearch V2 is
for you.

http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/


regds
mallah.



> 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';
>
> Any Ideas?
>
> Thanks in advance,

-- 
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.


pgsql-sql by date:

Previous
From: sri devi
Date:
Subject: Blobs
Next
From: "Vijay Kumar"
Date:
Subject: Problem with temporary table -- Urgent