merge cell contents

  • 18 years ago

    Lets say I have


    Table 1:
    OrderID   InvoiceID
    -----------  --------------
    10             ABC
    11             DEF
    12             GHI


    and


    Table2:
    OrderID   OrderedItem
    -----------  -----------------
    10             A1
    10             B2
    10             C3
    11             A1
    11             C3
    12             B2


    How do I get SQL to give me this output:


    OrderID   InvoiceID     Ordered_Items
    -----------  --------------    ------------------
    10             ABC               A1, B2, C3
    11             DEF                A1, C3
    12             GHI                B2



    Could anyone help me PLEASE?!


    Thanks a lot!


    Martin

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are only 3 numbers of interest to a computer scientist: 1, 0 and infinity”