Coalesce Question and the Laxy SQL Developer

  • New to these forums and an intermediate level SQL Developer...so be gentle.

    I'm stuck. I've used COALESCE a great deal but always to generate a single return value in the form of some delimited list. But what I need now is more complicated than that and I really was hoping maybe someone has had a similar problem.

    Table contains:

    id versionvalue

    100 20.10.2

    100 20.00.1

    100 8.18.55

    200 9.9.1

    200 10.0.01

    and what I want is a result set of

    id versionvalues

    100 20.10.2, 20.00.1, 8.18.55

    200 9.9.1, 10.0.01

    Is that possible in one query or series of sub-queries?

    Thanks,

    Mike

  • Read up on FOR XML PATH, it's a way of concatenating rows. There's an article on the simple-talk site.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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