我在mySQL中有以下查询
`SELECT * FROM (select assoc1 from fab_cbd where tournament = 65
union all
select assoc2 from fab_cbd where tournament = 65) x`使用它,我得到了包含这两列值的完整列表。我想要做的是根据这些值进行分组,并计算出现的次数。
提前谢谢。
发布于 2015-02-07 13:25:52
然后添加group by
SELECT assoc, count(*)
FROM (select assoc1 as assoc from fab_cbd where tournament = 65
union all
select assoc2 from fab_cbd where tournament = 65
) x
GROUP BY assoc;https://stackoverflow.com/questions/28382640
复制相似问题