On Thu, 10 Jul 2003, Tom Rochester wrote:
> I would like to achive something along the lines of:
>
> SELECT field FROM table WHERE field ILIKE '$searchterm' ORDER BY
> substr_count(field, '$searchterm');
If you have plperl installed:
create or replace function substr_count( varchar(255), varchar(255)
)
returns int as ' my ($field, $searchterm) = @_; my $count = $field =~ s/$searchterm//g; return $count;
' language 'plperl';
michael