comma seperated result in a subquery

  • Hi All,

    I need to produce a comma seperated result in a subquery that way reducing the record count in the main query, how do I do that.

    example:

    SELECT field1, field2, field3

    FROM TABLEA

    because of field3, i end up with multiple records. But if i concatenate the values with commas of field3 into one subquery, then i will end up with unique records

    thanks.

  • Take a look at this article[/url] (or many others out there) that describe how to use FOR XML PATH to concatenate values in a single column.

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Hi BTerraberry,

    Thank you for your time, that really worked. Thanks again.

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

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