Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2010
    Posts
    2

    Unanswered: How to Combine redundant values into one field using stored procedure !

    Hi,

    I have a table like this

    ID TERM CLASS
    ---------------------------
    304 20103 EE2
    156 20102 CS3
    167 20101 MC1
    167 20101 SE3

    As you can see, for the ID 167, there are two different values 'MC1' & 'SE3' under CLASS column. I want to create a query which coalesces
    'MC1' & 'SE3' into one field, I would like the resulting table to be like

    ID TERM CLASS
    ---------------------------
    304 20103 EE2
    156 20102 CS3
    167 20101 MC1,SE3

    Any help?

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Different answers are available depending on which verison of SQL Server you need to run the query. What is the earliest version of SQL Server you might use for this query?

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Dec 2010
    Posts
    2
    The SQL server version I am using is
    SQL server management studio express 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •