SQL Server : select each group of rows into a sing row
<p>It's hard to describe what I'd like to find out. Roughly, it's "to select each group of rows into a sing row".</p>

<p>Please refer to the linked image.</p>

<p>Thank you!!</p>

<p><a href="http://i.stack.imgur.com/RpP7m.jpg" rel="nofollow">click here for an image: SQL Server, select each group of rows into a sing row</a></p>

<p><strong>dbo.SourceTable</strong></p>

<pre><code>group   column1 column2
------------------------
A   A1  AA1
A   A2  AA2
A   A3  AA3
A   A4  AA4
A   A5  AA5
B   B1  BB1
B   B2  BB2
B   B3  BB3
B   B4  BB4
B   B5  BB5
C   C1  CC1
C   C2  CC2
C   C3  CC3
C   C4  CC4
C   C5  CC5
D   D1  DD1
D   D2  DD2
D   D3  DD3
D   D4  DD4
D   D5  DD5
</code></pre>

<p>Desired result:</p>

<pre><code>group   result1 result2 result3 result4 result5 result6 result7 result8 result9 result10
A   A1  AA1 A2  AA2 A3  AA3 A4  AA4 A5  AA5
B   B1  BB1 B2  BB2 B3  BB3 B4  BB4 B5  BB5
C   C1  CC1 C2  CC2 C3  CC3 C4  CC4 C5  CC5
D   D1  DD1 D2  DD2 D3  DD3 D4  DD4 D5  DD5
</code></pre>