我有一个 mysql 表,其中包含
id,(primary key)
user_id,
**number**,
date
列。我想要一个查询,为相同日期和相同的 user_id 选择计数数字。
例如,日期列有 3 个条目 09/07/2014,那么我想要一个返回计数 3 的查询。
我的 where 条件仅包含 user_id
SELECT number,date FROM play_history WHERE user_id =49
谢谢
最佳答案
select `date`, count(`number`) as num_count
from play_history
where user_id = 49
group by `date`
关于java - 如何使用mysql查询返回计数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24651722/