title: How to set all values for a column to a max value on a certain WHERE?
body: <p>If I have:</p>
  
  <pre><code> 2 baskets of oranges with 7 and 10 each
  
   3 baskets of peaches with 12 and 15 each
  </code></pre>
  
  <p>then I want to set: </p>
  
  <pre><code>for every orange basket value of maxfruit to 10 and 
  
  for every peach basket value of maxfruit to 15
  </code></pre>
  
  <p>I tried </p>
  
  <pre><code> update baskets set maxfruit = (select max(fruitCount) from baskets b where b.fruit = fruit)   
  </code></pre>
  
  <p>but it just sets everything to 15...</p>