이러한 테이블이 있습니다.


 A       B

-----------------

1       1

-----------------

1       2

-----------------

1       3

-----------------

1       4

-----------------

2       5

-----------------

2       6

-----------------

2       7

-----------------

2       8

-----------------

3       9

-----------------

3       10

-----------------

3       11

-----------------

3       12

-----------------


이 테이블을 

A 값으로 묶어서 그룹을 만든 다음

그 그룹값들을 순차적으로 컬럼에 붙여 나가는 테이블로 바꾸고 싶습니다.


 B1     B2      B3

---------------------------------------------------

1

---------------------------------------------------

2

---------------------------------------------------

3

---------------------------------------------------

4

---------------------------------------------------

1       5

---------------------------------------------------

2       6

---------------------------------------------------

3       7

---------------------------------------------------

4       8

---------------------------------------------------

1       5       9

---------------------------------------------------

2       6       10

--------------------------------------------------

3       7       11

---------------------------------------------------

4       8       12

---------------------------------------------------



또는 한 컬럼으로



 Result   

---------------------------------------------------

1

---------------------------------------------------

2

---------------------------------------------------

3

---------------------------------------------------

4

---------------------------------------------------

1,5

---------------------------------------------------

2,6

---------------------------------------------------

3,7

---------------------------------------------------

4,8

---------------------------------------------------

1,5,9

---------------------------------------------------

2,6,10

--------------------------------------------------

3,7,11

---------------------------------------------------

4,8,12

---------------------------------------------------



고민해봐도 감도 못잡아서 이렇게 질문해봅니다//

감사합니다~