June 1, 2017 at 1:49 pm
Hi All,
I was looking for code to split column value into separate rows..
Any help on this..
like for the example below , for ID =1 ,it should give 4 rows..like this
ID Category
1 5
1 H
1 W
1 6
create table TEST
(
ID char(10),
CATEGORY VARCHAR(10)
)
INSERT INTO TEST values(1,'5HW6')
INSERT INTO TEST values(2,'256')
INSERT INTO TEST values(3,'57')
INSERT INTO TEST values(4,'3')
INSERT INTO TEST values(5,'4578')
INSERT INTO TEST values(6,'256HW')
SELECT * from TEST
Thanks [/font]
June 1, 2017 at 4:31 pm
Duplicate post. Direct replies to https://www.sqlservercentral.com/Forums/FindPost1879210.aspx
Please don't cross post, as it fragments the discussion.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply