How to Display Multiple Values Same Row?

  •  

    Hi All,

    I have a query where I need to ONE row for each say Prod_Id...however there are multiple Assignees with the same Prod_Id...is there a way to produce a result set like this:

    1, (jackie, luke, alice), 34, tester, 68, GO

    Prod_id, Assignees, ALL other columns are the same...

    1, Jackie, 34, tester, 68, GO

    1, Luke, 34, tester, 68, GO

    1, Alice, 34, tester, 68, GO

    I've tried Distinct, Having and so on...still getting the multiple rows...I am joining tables to acquire the "Assignees" name...

    Thanks...

  • Please don't cross-post in multiple fora here. That makes it difficult to see who answered what where already.

    To answer your question, can you post your table structure(s)?

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • These are just just...the REAL tables are much larger and more columns in result set...I just want to get the small test join working before working with the BIG tables...

    table 1

    Prod_id int PK

    Assignee varchar50

     

    table 2

    Prod_id int PK - (FK to table 1)

    Test_id int

    TestUser varchar 50

    tUid int

    status varchar 50

     

    Result set:

    Want ALL columns but ONLY want 'Prod_id' to show up ONCE (1) even if there are multiple Assignees..

     

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

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