title: group a set of records by date in teradata
body: <p>Currently I have data in a table as shown below:</p>
  
  <pre><code>date        id   value
  1-Jan-13    1    100
  2-Jan-13    1    100
  3-Jan-13    1    100
  4-Jan-13    1    200
  5-Jan-13    1    200
  6-Jan-13    1    100
  7-Jan-13    1    100
  </code></pre>
  
  <p>I am trying to group the records based on the id and val and version records with startdate and end date .</p>
  
  <p>Desired output:</p>
  
  <pre><code>start date  end date    id   value
  1-Jan-13    3-Jan-13    1    100
  4-Jan-13    5-Jan-13    1    200
  6-Jan-13    7-Jan-13    1    100
  </code></pre>