I need to get value portion key to every 3 row on one row meaning
rn 1,2,3 one row KRM__21X0E100C0ADD
rn 1,2,3 one row KRM__21X0J100K0ADD
rn 1,2,3 on one row KRM__21X1C100D0ADD
- create table #portiontableFinal
- (
- rn int,
- ValuePortionKey nvarchar(100)
- )
- insert into #portiontableFinal(rn,ValuePortionKey)
- values
- (1,'KRM__21X0E100'),
- (2,'C0AD'),
- (3,'D'),
- (1,'KRM__21X0J100'),
- (2,'K0AD'),
- (3,'D'),
- (1,'KRM__21X1C100'),
- (2,'D0AD'),
- (3,'D')
- RN ValuePortionKey
- 1 KRM__21X0E100
- 2 C0AD
- 3 D
- 1 KRM__21X0J100
- 2 K0AD
- 3 D
- 1 KRM__21X1C100
- 2 D0AD
- 3 D
I need to get from 1 to 3 on one rows as following :
final result I need to get as below :
KRM__21X0E100C0ADD
KRM__21X0J100K0ADD
KRM__21X1C100D0ADD

Amit GuptaRank #190 · 12.8K reputationPosted Jan 26, 2021, 7:31 AM EST
ahmed elbarbaryRank #1,060 · 1.8K reputationPosted Jan 26, 2021, 7:46 AM EST
Rajanikant HawaldarRank #107 · 20.6K reputationPosted Jan 26, 2021, 8:24 AM EST
Amit GuptaRank #190 · 12.8K reputationPosted Jan 26, 2021, 9:05 AM EST
ahmed elbarbaryRank #1,060 · 1.8K reputationPosted Jan 26, 2021, 9:29 AM EST
Amit GuptaRank #190 · 12.8K reputationPosted Jan 26, 2021, 10:04 AM EST
ahmed elbarbaryRank #1,060 · 1.8K reputationPosted Jan 26, 2021, 3:57 PM EST
Amit GuptaRank #190 · 12.8K reputationPosted Jan 27, 2021, 12:55 AM EST