How to Avoid Cursor

  • Hi,

    I have a common table expression that returns the below

    Num

    1

    2

    3

    I also have a select statement that returns something like

    Name

    ABC

    DEF

    I need to write a select statement that will result in the below:

    Num Name

    1 ABC

    2 ABC

    3 ABC

    1 DEF

    2 DEF

    3 DEF

    How can this be achieved without writing loop script?

  • Is this homework? What have you tried so far? Hint: use CROSS JOIN.

    John

  • Use cross join

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply