这有效
SELECT DISTINCT b.b_id
FROM b INNER JOIN c
ON b.b_id=c.b_id
WHERE c.active='yes' AND b.featured='no'
当结果应该返回 0 行时,这将返回一个 count = 0 的空行
SELECT DISTINCT b.b_id, COUNT(c.c_id) AS count
FROM b INNER JOIN c
ON b.b_id=c.b_id
WHERE c.active='yes' AND b.featured='no'
难道我做错了什么?