<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Count number of words in a MySQL column</title>
	<atom:link href="http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/</link>
	<description>Bits and pieces of linux, mysql, apache, php</description>
	<lastBuildDate>Fri, 18 Nov 2011 19:18:37 +0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: F Laszlo</title>
		<link>http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/comment-page-1/#comment-38330</link>
		<dc:creator>F Laszlo</dc:creator>
		<pubDate>Fri, 18 Nov 2011 19:18:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/#comment-38330</guid>
		<description>Well, even if &quot;column be empty&quot; it works fine for me. Shows &quot;0&quot;.</description>
		<content:encoded><![CDATA[<p>Well, even if &#8220;column be empty&#8221; it works fine for me. Shows &#8220;0&#8243;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mhehm</title>
		<link>http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/comment-page-1/#comment-37786</link>
		<dc:creator>mhehm</dc:creator>
		<pubDate>Sat, 12 Nov 2011 07:22:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/#comment-37786</guid>
		<description>if column be empty, it show 1 and it is not correct</description>
		<content:encoded><![CDATA[<p>if column be empty, it show 1 and it is not correct</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mihai Vinatoru</title>
		<link>http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/comment-page-1/#comment-36199</link>
		<dc:creator>Mihai Vinatoru</dc:creator>
		<pubDate>Tue, 01 Nov 2011 12:14:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/#comment-36199</guid>
		<description>Great. Thank you for this code snippet. You saved my day ;)</description>
		<content:encoded><![CDATA[<p>Great. Thank you for this code snippet. You saved my day <img src='http://www.mwasif.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: F Laszlo</title>
		<link>http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/comment-page-1/#comment-20222</link>
		<dc:creator>F Laszlo</dc:creator>
		<pubDate>Wed, 08 Jun 2011 14:38:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/#comment-20222</guid>
		<description>Well done!
I&#039;ve got inspiration and implemented this:

select round((LENGTH(name) - LENGTH(REPLACE(name, &#039;word&#039;, &#039;&#039;))) /length(&#039;word&#039;))
from table;

This count only words &#039;word&#039;.</description>
		<content:encoded><![CDATA[<p>Well done!<br />
I&#8217;ve got inspiration and implemented this:</p>
<p>select round((LENGTH(name) &#8211; LENGTH(REPLACE(name, &#8216;word&#8217;, &#8221;))) /length(&#8216;word&#8217;))<br />
from table;</p>
<p>This count only words &#8216;word&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Imane</title>
		<link>http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/comment-page-1/#comment-11509</link>
		<dc:creator>Imane</dc:creator>
		<pubDate>Fri, 22 Jan 2010 18:39:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/#comment-11509</guid>
		<description>GREAT tip, i am trying to use this select statement to show all the words and sort them by number of occurence (how many times that occur).  Any help on this would be GREATLY appreciated. 

Thanks again</description>
		<content:encoded><![CDATA[<p>GREAT tip, i am trying to use this select statement to show all the words and sort them by number of occurence (how many times that occur).  Any help on this would be GREATLY appreciated. </p>
<p>Thanks again</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cormac</title>
		<link>http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/comment-page-1/#comment-8553</link>
		<dc:creator>cormac</dc:creator>
		<pubDate>Thu, 20 Aug 2009 20:53:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/#comment-8553</guid>
		<description>Has anyony managed an SQL query that will county the freuquency of words in column of a table?</description>
		<content:encoded><![CDATA[<p>Has anyony managed an SQL query that will county the freuquency of words in column of a table?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Al</title>
		<link>http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/comment-page-1/#comment-6167</link>
		<dc:creator>Al</dc:creator>
		<pubDate>Fri, 22 May 2009 05:15:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/#comment-6167</guid>
		<description>That&#039;s bloody awesome - very nice thinking outside of the box. Works a treat! Many thanks saves me bring everything in and doing it with php!</description>
		<content:encoded><![CDATA[<p>That&#8217;s bloody awesome &#8211; very nice thinking outside of the box. Works a treat! Many thanks saves me bring everything in and doing it with php!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajay Arjunan</title>
		<link>http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/comment-page-1/#comment-6069</link>
		<dc:creator>Ajay Arjunan</dc:creator>
		<pubDate>Tue, 12 May 2009 11:44:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/#comment-6069</guid>
		<description>Great !!! Thanks for this query.</description>
		<content:encoded><![CDATA[<p>Great !!! Thanks for this query.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BL</title>
		<link>http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/comment-page-1/#comment-6005</link>
		<dc:creator>BL</dc:creator>
		<pubDate>Mon, 04 May 2009 11:31:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/#comment-6005</guid>
		<description>The real solution is to replace double or more spaces in the first LENGTH():

SELECT SUM( LENGTH(REPLACE(REPLACE(name,&#039;   &#039;,&#039; &#039;),&#039;  &#039;,&#039; &#039;)) - LENGTH(REPLACE(name, &#039; &#039;, &#039;&#039;))+1)
FROM table;

Replacing double or more spaces in the second LENGTH() won&#039;t modify the result, because it has the same effect as the first solution has: all spaces are removed from text.</description>
		<content:encoded><![CDATA[<p>The real solution is to replace double or more spaces in the first LENGTH():</p>
<p>SELECT SUM( LENGTH(REPLACE(REPLACE(name,&#8217;   &#8216;,&#8217; &#8216;),&#8217;  &#8216;,&#8217; &#8216;)) &#8211; LENGTH(REPLACE(name, &#8216; &#8216;, &#8221;))+1)<br />
FROM table;</p>
<p>Replacing double or more spaces in the second LENGTH() won&#8217;t modify the result, because it has the same effect as the first solution has: all spaces are removed from text.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Knut Urdalen</title>
		<link>http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/comment-page-1/#comment-5621</link>
		<dc:creator>Knut Urdalen</dc:creator>
		<pubDate>Fri, 24 Apr 2009 07:03:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.mwasif.com/2008/12/count-number-of-words-in-a-mysql-column/#comment-5621</guid>
		<description>Very nice Wasif :) It saved my day! Thanks!</description>
		<content:encoded><![CDATA[<p>Very nice Wasif <img src='http://www.mwasif.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It saved my day! Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

