title: Max a Sum of a partition by
body: <p>I have the below table. </p>
  
  <p>I would like to SUM hours and partition by id then take the <code>Max</code> hours per custid. Below is what I have so far. </p>
  
  <p>TableA</p>
  
  <pre><code>id    custid    projid   hours
   1      1010     Yellow    1
   1      1011     Yellow    2
   1      1012     Yellow    5
   1      1010     Yellow    5
  </code></pre>
  
  <p>SQL:</p>
  
  <pre><code>select SUM(HOURS)OVER (PARTITION BY ID ORDER BY cust) AS TOTAL_HRS
  from tablea
  </code></pre>
  
  <p>Expected Output: The above SQL does not capture <code>MAX</code> hours</p>
  
  <pre><code>id    custid  projid  hours
   1      1010   Yellow  6
  </code></pre>