title: Find sum of points and grouping
body: <p>my table</p>
  
  <p>Reference :  <a href="http://www.sqlfiddle.com/#!2/6be93/1" rel="noreferrer">http://www.sqlfiddle.com/#!2/6be93/1</a></p>
  
  <p><img src="https://i.stack.imgur.com/BmeZD.png" alt="enter image description here"></p>
  
  <p>Here I would like to find Total point of a School. I am using following code.</p>
  
  <pre><code>  SELECT School, SUM(GroupPoint) AS TotalC1, SUM(C2Points) AS TotalC2,
    SUM(C3Points) AS TotalC3, SUM(GroupPoint + C2Points + C3Points) AS TotalAll 
    FROM students GROUP BY School ORDER BY TotalAll DESC LIMIT 6
  </code></pre>
  
  <p>Reference : <a href="http://www.sqlfiddle.com/#!2/25ed3/2" rel="noreferrer">http://www.sqlfiddle.com/#!2/25ed3/2</a></p>
  
  <p>my problem, the ID 1,2,3 are the winners of a group competition. So they get 5 points individually. But for that competition, the SCHOOL will get only 5 points not 15. A group can be Identify by same ChessNO.</p>
  
  <p>So my final output looks</p>
  
  <pre><code> SCHOOL   TOTALC1   TOTALC2  TOTALC3 TOTALALL
   School2   13       49       3       65       
   School1   5        4        25      34
  </code></pre>
  
  <p>It would be grateful if anybody could help me,</p>