title: SQL Query for Grouping the results based on sequence
body: <p>I have a table like this:</p>
  
  <pre><code>ID  Seq  Amt
  1   1    500
  1   2    500
  1   3    500
  1   5    500
  2   10   600
  2   11   600
  3   1    700
  3   3    700
  </code></pre>
  
  <p>I want to group the continuous sequence numbers into a single row like this:</p>
  
  <pre><code>ID  Start  End  TotalAmt
  1   1      3    1500
  1   5      5    500
  2   10     11   1200
  3   1      1    700
  3   3      3    700
  </code></pre>
  
  <p>Please help to achieve this result.</p>