TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ahmed elbarbary
NA
1.6k
277.7k
How to get value portion key to every rn from 1 to 3 row on one row?
Jan 26 2021 9:11 AM
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
Reply
Answers (
8
)
How to pass an value to the stored procedure
SQL Query for display single records from two records