我有一个这样的mysql数据库:
id - join_id - bool
1 - 32 - 1
2 - 32 - 0
3 - 32 - 1
4 - 32 - 1我想对此提出疑问:
join_id - bool (- amount)
32 - 1 - 3 (aka there are 3 instances where the join_id and bool are 32 and 1);
32 - 0 - 1 (aka there is 1 instances where the join_id and bool are 32 and 0);任何关键词或名字都会很有帮助。
发布于 2011-08-13 04:26:31
我想这就是你要找的东西:
SELECT join_id, bool, COUNT(id) AS amount FROM mytable GROUP BY join_id,boolhttps://stackoverflow.com/questions/7045843
复制相似问题