posts - 25,  comments - 0,  trackbacks - 0
mysql> desc tb_user_anonymous_history;
+----------------+---------------------+------+-----+---------+-------+
| Field          | Type                | Null | Key | Default | Extra |
+----------------+---------------------+------+-----+---------+-------+
| u              | char(64)            | NO   | PRI | NULL    |       |
| day_index      | int(10) unsigned    | NO   | PRI | 0       |       |
| last_fight_day | int(10) unsigned    | NO   |     | 0       |       |
| fight_win      | tinyint(3) unsigned | NO   |     | 0       |       |
| fight_total    | tinyint(3) unsigned | NO   |     | 0       |       |
+----------------+---------------------+------+-----+---------+-------+
select u,sum(fight_total) as total from tb_user_anonymous_history  where last_fight_day>=20120423 and last_fight_day <=20120424  group by u having total >= 12;
posted on 2012-05-02 10:56 nk_ysg 阅读(268) 评论(0)  编辑 收藏 引用 所属分类: MYSQL

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理