Parent Child Relation...

  • Hi,

    I need ur kind help on the attached xl.

    Thanks,

    Rajesh N.

  • Try using the ROLLUP operator.

    Something like

    SELECT

    level1,

    level2,

    level3,

    SUM(CalcField1) ,

    GROUPING(level1) AS 'IsGrandTotal',

    GROUPING(level2) AS 'IsTotal_Level1',

    GROUPING(level3) AS 'IsTotal_Level2'

    FROM yourTable

    GROUP BY level1,level2,level3

    WITH ROLLUP

    For details please see BOL, section GROUPING "function"



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Thanks Members...I'll check & let u know.

    Once again thanks for your help.

    regards

    raaj

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

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