title: how to repeat first value of a (ordered) column grouping by another column
body: <p>I have a simple table that is ordered by column ind and contains </p>
  
  <pre><code>create table #test (Ind int, Value int);
  
  insert into #test (Ind, Value) values
  (1, 3),
  (2, 3),
  (3, 3),
  (4, 5),
  (5, 6),
  (6, 6),
  (7, 3),
  (8, 3);
  </code></pre>
  
  <p>Now I need a query that returns three columns: Ind, value and FirstInd. FirstInd should be the first "Ind" value within a group of "value" columns:</p>
  
  <pre><code>Ind Value FirstInd
  1   3     1
  2   3     1
  3   3     1
  4   5     4
  5   6     5
  6   6     5
  7   3     7
  8   3     7
  </code></pre>
  
  <p>I already tried several things and as I'm using SQL Server 2012 I could also use "lag(Ind) over (Group by Ind)" for FirstInd, but in the end I didn't find a solution yet to what first looked like a simple Problem to me.</p>