How can you keep models reviewed by at least two distinct people?
HAVING filters groups after grouping. COUNT(DISTINCT reviewer) counts the different reviewers in each group.
SQLite example and interpretation
A has two reviewers while B has two scores from one person. Counting submissions would incorrectly admit B.
WITH r(m,u) AS (VALUES('A',1),('A',2),('B',3),('B',3)) SELECT m FROM r GROUP BY m HAVING count(DISTINCT u)>=2;Result [["A"]]
中文
如何筛出至少被两名评审打过分的模型?
HAVING 在分组后筛组选项,COUNT(DISTINCT reviewer) 按组计算不同评审人数。
SQLite 示例与适用条件
A 有两名评审,B 的两条记录来自同一人。把记录数当人数会让 B 误过门槛。
WITH r(m,u) AS (VALUES('A',1),('A',2),('B',3),('B',3)) SELECT m FROM r GROUP BY m HAVING count(DISTINCT u)>=2;结果 [["A"]]