title: SQL Join with "AND" + "OR" statement
body: <p>I am having trouble with this SQL statement. I am trying to restrict the results to the players with the ID's '25' and '87'. There is no error on the query ( I am getting every PID with this query)  This is the statement. </p>
  
  <pre><code>SELECT Rosters.PID, SUM( Rosters.Goals ) Goals, SUM( Rosters.Assists ) Assists, SUM( Rosters.PIM ) PIM, Rosters.TID, Players.pid, Players.firstname, Players.lastname, 
         SUM((Rosters.Goals + Rosters.Assists)) AS Points, Teams.tid, Teams.teamname
         FROM Rosters
         INNER JOIN Players
         ON Rosters.PID = Players.pid
         INNER JOIN Teams 
         ON Rosters.TID = Teams.tid
         WHERE ((Rosters.TID BETWEEN 9 AND 16) AND (Players.pid = 25 OR 87))
         GROUP BY 
         Players.pid
         ORDER BY Points DESC
  </code></pre>
  
  <p>I am almost certain this is the cause of my lack of SQL understanding, but W3C schools does not offer more complex solutions and the Stack threads I have looked up have been pretty localized. </p>
  
  <p><a href="http://ecmayhem.com/battle.php" rel="nofollow">Here is the current output. It should just be the players with Id's 25 and 87</a></p>