I want to update all the rows after the first row for each Team. Update StartTime and EndTime
<p>I want to update all the rows after the first row for each Team.</p>

<p><strong>TableName: Test</strong></p>

<pre><code>ID , Team , StartTime, EndTime, Estimated Time
1     A      18:00      20:00       1:00
2     B      18:00      20:00       5:00
3     A      18:00      20:00       6:00
4     F      18:00      20:00       0:30
5     B      18:00      20:00       1:00
6     B      18:00      20:00       2:30
7     A      18:00      20:00       1:30

UPDATE #TEST SET EndTime=  DateAdd(SECOND, Estimated Time* 60, StartTime)
UPDATE #TEST SET StartTime=  DateAdd(SECOND, - Estimated Time * 60, EndTime)
</code></pre>

<p>So here, I want to update row 3 and 7 (for team A) and row  5 and 6 for (team B)  (as they are not first records based on team),</p>

<p>Also the update on the EndTime, for each record should use the calculated startTime + estimated time. and also The Updated Start Time should used the calculated End Time. (while ignoring the first record of that team)</p>

<p>So ideally the result set should be like this...</p>

<p><strong>TableName: Test</strong></p>

<pre><code>ID , Team , StartTime, EndTime, Estimated Time
1     A      18:00      19:00       1:00
2     B      18:00      23:00       5:00
3     A      19:00      01:00       6:00
4     F      18:00      18:30       0:30
5     B      23:00      00:00       1:00
6     B      23:00      01:30       2:30
7     A      01:00      02:30       1:30
</code></pre>

<p>How do i achieve this in sql?</p>