我有两个问题
select TC,li,it as ee from results
where li = "not_applicable" and cpirt = "uu_X1"
以上查询将输出10个结果, 但如果我把计数放在同一个查询中,那么只有一个结果。
select TC,li,it,COUNT(TC) as ee from results
where li = "not_applicable" and cpirt = "uu_X1"
如何使用MYSQL
使第二个查询输出每个TC
的计数
感谢。
答案 0 :(得分:3)
添加GROUP BY TC
。
我愿意:
select TC,COUNT(TC) as ee from results
where results.li = "not_applicable" and results.cpirt = "uu_X1"
GROUP BY TC