这是我的 table
从上面
我的查询是
SELECT count_id, COUNT( questionID ) AS qid
FROM `sg_count`
GROUP BY count_id
它将得到输出
我还想使用第一个查询的结果来计算(count_id)谁拥有qid <5
最佳答案
试试这个 -
"SELECT count(qid) FROM (
SELECT count_id, COUNT( questionID ) AS qid FROM `sg_count` GROUP BY count_id
) as count_data where qid < 5" ;
关于php - 从其他查询mysql的结果生成结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25926336/