title: Conditional Sort In Groups
body: <p>Please consider this result set:</p>
  
  <pre><code>Name     Value1     Value2     Value3
  ---------------------------------------
  ccc       1          2           3
  aaa       3          4           3
  bbb       2          8           5
  Group 1   2          1           3
  rrr       1          2           5
  mmm       3          4           4
  nnn       3          2           1
  eee       2          6           5
  Group 2   2          4           4
  ...
  </code></pre>
  
  <p>As you see the record in each group don't sorted in alphabetically order. How I can sort record in each group alphabetically?</p>
  
  <p>The desired result set is:</p>
  
  <pre><code>Name     Value1     Value2     Value3
  ---------------------------------------
  aaa       3          4           3
  bbb       2          8           5
  ccc       1          2           3
  Group 1   2          1           3
  eee       2          6           5
  mmm       3          4           4
  nnn       3          2           1
  rrr       1          2           5
  Group 2   2          4           4
  ...
  </code></pre>
  
  <p><strong>EDIT 1)</strong></p>
  
  <p>Code for generat base result set:</p>
  
  <pre><code>DECLARE @tbl AS Table
  (
      Name NVARCHAR(50),
      Value1 DECIMAL(5,2),
      Value2 DECIMAL(5,2),
      Value3 DECIMAL(5,2)
  )   
  
  INSERT INTO @tbl VALUES('ccc',1,2,3)
  INSERT INTO @tbl VALUES('aaa',3,4,3)
  INSERT INTO @tbl VALUES('bbb',2,8,5)
  INSERT INTO @tbl VALUES('Group 1',2,1,3)
  INSERT INTO @tbl VALUES('rrr',1,2,5)
  INSERT INTO @tbl VALUES('mmm',3,4,4)
  INSERT INTO @tbl VALUES('nnn',3,2,1)
  INSERT INTO @tbl VALUES('Group 2',2,4,4)
  
  select * from @tbl
  </code></pre>