Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Split Rows in to another set as columns in sql ?

$
0
0

Hi,

I have a sample data..

Id

ENAME

GRADE

1

MILLER         

2

2

CLARK          

4

3

KING           

7

4

ADAMS          

5

5

FORD           

1

6

JAMES          

6

7

MARTIN         

10

8

ALLEN          

3

9

BLAKE          

8

10

REDDY

1

I would like to split 5 rows in to another column set like this..

Please help me on this.

Thank you.

Id

ENAME

GRADE

Id1

ENAME1

GRADE1

1

MILLER         

2

6

JAMES          

6

2

CLARK          

4

7

MARTIN         

10

3

KING           

7

8

ALLEN          

3

4

ADAMS          

5

9

BLAKE          

8

5

FORD           

1

10

REDDY

1


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>