Weird grouping requirement

  • I have a Table1 with the following data:

    DistrictAreaWeatherID

    D11A1

    D11B1

    D11C2

    D22A1

    D22A3

    D22B2

    D33A1

    D33B2

    D33C

    Now I want to group on District and Area in such a way that the result set looks like:

    DistrictAreaWeatherID

    1A1

    1B1

    1C2

    D11,2

    2A1,3

    2B2

    D21,2,3

    3A1

    3B2

    3C

    D31,2

    Any suggestions?

    Thanks!

  • Could you re-post the question in a manner which makes the desired result a little more clear. It looks like some of the results rows have commas and some don't the rows with commas seem to have more columns. You may want to insert the results in a table to make it a little more clear. Also a code block may help.

    Thanks,

    Steve
    http://stevefibich.net
    http://utilitydb.codeplex.com/

  • The result table should look like the attached pic.

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

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