Aggregation of records

  • I have a table where following records to be aggregated

    •First, Middle, and Last Name

    •B

    •ID

    • Date

    And than exclude ceratin data based on this aggregation. Afterwards aggregate data on category column so that end result will be one aggregated row

    •First, Middle, and Last Name

    •B

    •ID

    Category

    How do I do this using T-SQL

  • It would be better if you post the structure of your table and some test data then your desire results!

    I'm sure that you will have many alternatives how to do that!

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

  • My recommendation is that you read the article at the first link in my signature line below.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Thanks all for your responses. I got it resolved. It was a pretty simple thing.

  • saurabh Srivastava-398090 (3/30/2010)


    Thanks all for your responses. I got it resolved. It was a pretty simple thing.

    It's always nice to know the problem is solved...though it would be nice if you shared the details, for the benefit of anyone else reading your thread who has the same problem.

Viewing 5 posts - 1 through 4 (of 4 total)

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