Grouping Sets

  • SanDroid

    SSChampion

    Points: 10068

    Revenant (8/30/2011)


    Thank you, Dee! It compelled me to re-read GROUPING SETS.

    Thank you Revenant. It is a great new feature for grouping and set based query.

  • Skanker

    Hall of Fame

    Points: 3059

    Thanks for this question. As a relative newbie I think I will find this useful in future.

  • SanDroid

    SSChampion

    Points: 10068

    tim.kay (8/30/2011)


    Thanks for this question. As a relative newbie I think I will find this useful in future.

    It can really cut down on the number of times you use UNION ALL. 😎

  • TomThomson

    SSC Guru

    Points: 104773

    SanDroid (8/30/2011)


    Thank you Tom.

    It was your reply to my comments that inspired me to write this question.

    So I would call it inspiration before plagerism. 😉

    This question is based on one posted before.

    http://www.sqlservercentral.com/questions/T-SQL/64301/

    The example scripts, and the answer, are not the same.:cool:

    The important difference, I think, is that in your version the answer is right while in the previous version the answer was wrong. :smooooth:

    Tom

  • sathishmcc

    SSC-Addicted

    Points: 424

    Hi, this "grouping sets" available in sql server 2005 i tried it shows error...is it in advanced version.

  • Ken Wymore

    SSCoach

    Points: 16598

    sathishmcc (8/30/2011)


    Hi, this "grouping sets" available in sql server 2005 i tried it shows error...is it in advanced version.

    This feature is not available in SQL Server 2005. It works with SQL Server 2008 and newer.

  • SanDroid

    SSChampion

    Points: 10068

    Tom.Thomson (8/30/2011)


    SanDroid (8/30/2011)


    Thank you Tom.

    It was your reply to my comments that inspired me to write this question.

    So I would call it inspiration before plagerism. 😉

    This question is based on one posted before.

    http://www.sqlservercentral.com/questions/T-SQL/64301/

    The example scripts, and the answer, are not the same.:cool:

    The important difference, I think, is that in your version the answer is right while in the previous version the answer was wrong. :smooooth:

    Tom I seriously apreciate that. I respect your opinion always. 🙂

  • SanDroid

    SSChampion

    Points: 10068

    sathishmcc (8/30/2011)


    Hi, this "grouping sets" available in sql server 2005 i tried it shows error...is it in advanced version.

    That is correct. I began the question with

    SQL Server 2008 introduces GROUPING SETS

    so that thier would not be any confusion about the server version that supports it.

  • Kenneth.Fisher

    SSCoach

    Points: 19789

    Great question. I love the ones that show me something new.

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • Vinay Kumar

    SSCertifiable

    Points: 6098

    Got new thing . thx

    Thanks
    Vinay Kumar
    -----------------------------------------------------------------
    Keep Learning - Keep Growing !!!

  • Iulian -207023

    SSCertifiable

    Points: 7509

    Interesting! according to msdn "GROUPING SETS can generate a result equivalent to that generated by a simple GROUP BY, ROLLUP or CUBE operation."

    Thank you,

    Iulian

  • CoolCodeShare

    SSCrazy

    Points: 2584

    Nice question on Grouping Sets.

Viewing 12 posts - 16 through 27 (of 27 total)

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