<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
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/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>MySQL Diary &#187; count(*) Archives  &#8211; MySQL Diary</title> <atom:link href="http://www.mysqldiary.com/tag/count/feed/" rel="self" type="application/rss+xml" /><link>http://www.mysqldiary.com</link> <description>Exploring, Sharing and  Discussing MySQL practice</description> <lastBuildDate>Mon, 18 Jul 2011 20:03:03 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Limited SELECT count(*)</title><link>http://www.mysqldiary.com/limited-select-count/</link> <comments>http://www.mysqldiary.com/limited-select-count/#comments</comments> <pubDate>Thu, 13 May 2010 21:52:43 +0000</pubDate> <dc:creator>Hazan Ilan</dc:creator> <category><![CDATA[Cool MySQL Queries]]></category> <category><![CDATA[count(*)]]></category> <category><![CDATA[limit]]></category> <category><![CDATA[limited count]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[select]]></category> <guid
isPermaLink="false">http://www.mysqldiary.com/?p=98</guid> <description><![CDATA[<div
class="addthis_toolbox addthis_default_style " addthis:url='http://www.mysqldiary.com/limited-select-count/' addthis:title='Limited SELECT count(*) '  ><a
class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a
class="addthis_button_tweet"></a><a
class="addthis_counter addthis_pill_style"></a></div>A SELECT statement with COUNT returns the number of rows retrieved by the SELECT statement (see mysql select count). For performance reasons, the desired result is to limit that count. Including a LIMIT clause in the SELECT statement will not work since it only restricts the number of rows returned, which is always one. The [...]<div
class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.mysqldiary.com/limited-select-count/' addthis:title='Limited SELECT count(*) ' ><a
class="addthis_button_preferred_1"></a><a
class="addthis_button_preferred_2"></a><a
class="addthis_button_preferred_3"></a><a
class="addthis_button_preferred_4"></a><a
class="addthis_button_compact"></a></div>]]></description> <wfw:commentRss>http://www.mysqldiary.com/limited-select-count/feed/</wfw:commentRss> <slash:comments>23</slash:comments> </item> </channel> </rss>
