RE: Count occurrence of word in a column

2001-12-13 Thread Ron Jamison

I don't think theres a MySQL function to return the number of times a phrase
appears inside a field.

Another way you could achieve the same goal:

SELECT field FROM table WHERE field LIKE '%word%word%word%'

^-- would match on three occurences of 'word'

If you need a count of the number of times 'word' appears in that field
you're out of luck so far as the MySQL SELECT() is concerned.  You'll have
to select those rows and then count the # of times 'word' appears in the
returned data.

-Original Message-
From: Michael Collins [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 13, 2001 12:22 PM
To: [EMAIL PROTECTED]
Subject: Count occurrence of word in a column


How can I most efficiently return just the count of some word in a
large text field in a MySQL db, without returning the actual text
field contents. I am looking for the number of times the word appears
with a specific column, not count() of all columns that have that
word.

--
Michael
__
||| Michael Collins   |||
||| Kuwago Web Services   |||  mailto:[EMAIL PROTECTED]
||| Seattle, WA, USA  |||  http://www.lassodev.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Count occurrence of word in a column

2001-12-13 Thread Michael Collins

How can I most efficiently return just the count of some word in a 
large text field in a MySQL db, without returning the actual text 
field contents. I am looking for the number of times the word appears 
with a specific column, not count() of all columns that have that 
word.

-- 
Michael
__
||| Michael Collins   |||
||| Kuwago Web Services   |||  mailto:[EMAIL PROTECTED]
||| Seattle, WA, USA  |||  http://www.lassodev.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php