所以我试图检查哪个玩家拥有所有图标,因为查询变成了3个图标:
SELECT PlayerID from OwnedIcon GROUP BY PlayerID HAVING COUNT(IconID)=3;
但是,如果我不想在数字中使用它,那么如果我想稍后添加图标,那么查询将不会发生变化?我试过这个,但似乎错了:
SELECT PlayerID from OwnedIcon GROUP BY PlayerID HAVING COUNT(IconID)= SELECT COUNT (*) FROM Icon;
有没有办法改变它,还是我必须坚持使用数字?
答案 0 :(得分:1)
SELECT PlayerID
from OwnedIcon
GROUP BY PlayerID
HAVING COUNT(distinct IconID) = (SELECT COUNT(*) FROM Icon)