October 1, 2012 at 2:35 pm
Hello,
I have the records set as follow:
COL1 COL2 COL3
1 12 0
1 13 0
1 14 1
1 15 1
And Wanted the output from above recordset as follows:
COL1 COL2 COL3 Group
1 12 0 1
1 13 0 1
1 14 1 1
1 12 0 2
1 13 0 2
1 15 1 2
Can anyone please suggest the way AND SQL Query to duplicate the row 1 and 2 against row 3 and 4?
Thanks
Shuaib
October 1, 2012 at 2:51 pm
Cross join the table or join it to itself.
Please post DDL statements, and the query you tried.
October 1, 2012 at 3:58 pm
Attached the Test Script File. CROSS JOIN didn't work.
October 1, 2012 at 5:26 pm
I have got the solution. CROSS JOIN worked for me.
Thanks
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply