Result in separate column?

  • Hi,

    Result in separate column?

    I have data like one row (ab-xyz, bc-xyz, cd- xyz)

    I want output, how to split these two different columns in one single row data?

    Col1col2

    abxyz

    bcxyz

    cdxyz

    thanks

    ananda

  • You may try to use recursive CTE..

  • A string splitter such as the delimitedsplit8k that can be found here on SSC would be a good start if the data is concatenated into a single string. This would be to get the string into multiple rows.

    Then, the use of substring and maybe charindex could possibly help to get the results into two columns.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

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

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