SQL update multiple rows with condition
<pre><code>Name   id  Col1  Col2  Col3 
Row1   1    6     1     A    
Row2   2    2     3     B    
Row3   3    9     5     B    
Row4   4    16    8     C    
</code></pre>

<p>I want to update the column with condition.</p>

<p>In first row,</p>

<pre><code>update col2 = Col1+0 if Col3 = A 
OR 
col2 = Col1-0 if Col3 = B 
OR 
col2 = Col1*0 if Col3 = C
</code></pre>

<p>In second row,</p>

<pre><code>update col2 = (previous col2) + Col1 if Col3 = A 
OR
col2 = (previous col2) - Col1 if Col3 = B 
OR
col2 = (previous col2) * Col1 if Col3 = C 
</code></pre>

<p>The same goes to third row</p>