﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-yesg-随笔分类-MYSQL</title><link>http://www.cppblog.com/yesg/category/19620.html</link><description /><language>zh-cn</language><lastBuildDate>Fri, 13 Jul 2012 07:15:52 GMT</lastBuildDate><pubDate>Fri, 13 Jul 2012 07:15:52 GMT</pubDate><ttl>60</ttl><item><title>mysql里面的寻找和大于一定数量查询</title><link>http://www.cppblog.com/yesg/archive/2012/05/02/173440.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Wed, 02 May 2012 02:56:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2012/05/02/173440.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/173440.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2012/05/02/173440.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/173440.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/173440.html</trackback:ping><description><![CDATA[<div><div></div><div>mysql&gt; desc tb_user_anonymous_history;</div><div>+----------------+---------------------+------+-----+---------+-------+</div><div>| Field &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| Type &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| Null | Key | Default | Extra |</div><div>+----------------+---------------------+------+-----+---------+-------+</div><div>| u &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| char(64) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| NO &nbsp; | PRI | NULL &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; |</div><div>| day_index &nbsp; &nbsp; &nbsp;| int(10) unsigned &nbsp; &nbsp;| NO &nbsp; | PRI | 0 &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; |</div><div>| last_fight_day | int(10) unsigned &nbsp; &nbsp;| NO &nbsp; | &nbsp; &nbsp; | 0 &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; |</div><div>| fight_win &nbsp; &nbsp; &nbsp;| tinyint(3) unsigned | NO &nbsp; | &nbsp; &nbsp; | 0 &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; |</div><div>| fight_total &nbsp; &nbsp;| tinyint(3) unsigned | NO &nbsp; | &nbsp; &nbsp; | 0 &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; |</div><div>+----------------+---------------------+------+-----+---------+-------+</div><div></div>select u,sum(fight_total) as total from tb_user_anonymous_history &nbsp;where last_fight_day&gt;=20120423 and last_fight_day &lt;=20120424 &nbsp;group by u having total &gt;= 12;</div><img src ="http://www.cppblog.com/yesg/aggbug/173440.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2012-05-02 10:56 <a href="http://www.cppblog.com/yesg/archive/2012/05/02/173440.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>