<?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>最优良人 &#187; count(*)</title>
	<atom:link href="http://www.zui88.com/view-tag/count/feed" rel="self" type="application/rss+xml" />
	<link>http://www.zui88.com/blog</link>
	<description>中山php&#124;最优网络</description>
	<lastBuildDate>Mon, 13 May 2013 04:56:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Mysql查询数据表中某字段重复出现的次数，并按照次数排序</title>
		<link>http://www.zui88.com/blog/view-90.html</link>
		<comments>http://www.zui88.com/blog/view-90.html#comments</comments>
		<pubDate>Sat, 13 Aug 2011 18:29:55 +0000</pubDate>
		<dc:creator>lin</dc:creator>
				<category><![CDATA[数据库]]></category>
		<category><![CDATA[count(*)]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.zui88.com/blog/?p=90</guid>
		<description><![CDATA[利用Mysql中的 的聚合函数 count(*) 可以实现这个功能，例如需要查询data表中name出现次数最多的记录，可以先按照group by name分组，用count算出分组里的条数，再按照count排序： select name,count(*) from data group by name order by count(*) DESC limit 1 不加limit限制将返回按照name重复次数排列的数据]]></description>
			<content:encoded><![CDATA[<div style="line-height: 25px;">
<p>利用Mysql中的 的聚合函数 count(*) 可以实现这个功能，例如需要查询data表中name出现次数最多的记录，可以先按照group by name分组，用count算出分组里的条数，再按照count排序：</p>
<p>select name,count(*) from data group by name order by count(*) DESC limit 1</p>
<p>不加limit限制将返回按照name重复次数排列的数据</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.zui88.com/blog/view-90.html/feed</wfw:commentRss>
		<slash:comments>419</slash:comments>
		</item>
	</channel>
</rss>
