If i use this query:
SELECT map.x,map.y,users.username,Count(username) as count
FROM map LEFT JOIN users ON (map.x=users.x AND map.y=users.y)
WHERE map.y BETWEEN 0 AND 2 AND map.x BETWEEN 0 AND 2
GROUP BY map.x,map.y
ORDER BY map.y DESC,map.x
I get this result:
(Original image: http://i.stack.imgur.com/3AOgH.png)
(I don't need the usernames, it is here just for the explanation) But i don't want to count for example "valaki", so i would like to get a result like this:
(Original image: http://i.stack.imgur.com/URGFs.png)
But with this code i get someting completely different:
SELECT map.x,map.y,users.username,Count(username) as count
FROM map LEFT JOIN users ON (map.x=users.x AND map.y=users.y)
WHERE map.y BETWEEN 0 AND 2 AND map.x BETWEEN 0 AND 2 AND users.username!='valaki'
GROUP BY map.x,map.y
ORDER BY map.y DESC,map.x
This:
(Original image: http://i.stack.imgur.com/pO1Iy.png)
(Those places where players aren't 'valaki', but i need those to where nobody is.)
If somebody can fix my query, i would be very happy. Thank you!