dimanche 17 avril 2016

how to get every value of the table?

So I was trying to check which player owns all the icons and since there are 3 icons the query becomes:

SELECT PlayerID from OwnedIcon GROUP BY PlayerID HAVING COUNT(IconID)=3;

But what if I don't want it in numbers so if I want to add icons later the query won't change? I tried this but seems like it's dead wrong:

SELECT PlayerID from OwnedIcon GROUP BY PlayerID HAVING COUNT(IconID)= SELECT COUNT (*) FROM Icon;

Is there any way to change it or do I have to stick with numbers?

Aucun commentaire:

Enregistrer un commentaire