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 阅读(277)
评论(0) 编辑 收藏 引用 所属分类:
MYSQL