title: sql [db2] select statement with condition
body: <p>I have two tables.<br>
  player1 has rows username, score, game_id, ...<br>
  player2 has rows username, score, game_id...<br>
  how do you select the username with the biggest score for the same game_id?  </p>
  
  <p>what I have is  </p>
  
  <pre><code>SELECT player1.username winning,
    player1.points,
    player1.game_id 
  FROM player1 
  INNER JOIN player2 ON player1.game_id = player2.game_id
  WHERE player1.points &gt; player2.points
  </code></pre>
  
  <p>and  </p>
  
  <pre><code>SELECT player2.username winning,
    player2.points,
    player2.game_id 
  FROM player1 
  INNER JOIN player2 ON player1.game_id = player2.game_id
  WHERE player2.points &gt; player1.points  
  </code></pre>