[Gllug] OT: SQL counting regex matches within a field

Ian Norton bredroll at darkspace.org.uk
Thu Jul 3 21:31:57 UTC 2003


nope, i know about the nice count :-) it counts the number of rows the query
returns,

what i want to do is this,

i have some text stored in the table Archives in the field Comments

i want to search through the text stored in Archive.Comments and count the
number of times a specific word appears in that text, 

me need help :-p

Ian

On Thu, Jul 03, 2003 at 10:20:45PM +0100, Sean Burlington wrote:
 Ian Norton wrote:
> >Hi folks,
> >
> >does anyone know how to cound the number of times a match occurs within a
> >field in mysql?
> >
> >my only working method involves iterating through every field using perl 
> >and
> >counting the regex matches, i dont want to have to do that really :-/
> >
> >Ian
> >
> 
> select count(some_non_null_column) from data where condition = 1;
> 
> -- 
> 
> Sean
> 
> 
> -- 
> Gllug mailing list  -  Gllug at linux.co.uk
> http://list.ftech.net/mailman/listinfo/gllug

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS dpu s--: a-- C++++ UL++ P+++ L+++ E--- W-- N+ o K w---
O M-- V-- PS++ PE-- Y+ PGP+ t+++ 5++ X++ R+++ !tv b DI D----
G++ e+ h++ r++ y+++
------END GEEK CODE BLOCK------
----- Message of the Hour ------
Moooo :-)

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list