SQL QUERY - DUPLICATING THE RECORDS

  • 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

  • Cross join the table or join it to itself.

    Please post DDL statements, and the query you tried.

  • Attached the Test Script File. CROSS JOIN didn't work.

  • 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