T-SQL 2008

  • Comments posted to this topic are about the item T-SQL 2008

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • I'm of the opinion that the answer(s) are incorrect.

    CUBE and ROLLUP where already available in SQL Server 2005, so they were not introduced with SQL Server 2008.

  • Mighty (10/1/2009)


    I'm of the opinion that the answer(s) are incorrect.

    CUBE and ROLLUP where already available in SQL Server 2005, so they were not introduced with SQL Server 2008.

    I second this opinion.

  • I am also of the opinion that the answer is incorrect.

    The question specifically asks for extensions (subclauses) to the GROUP BY clause.

    GROUPING_ID is a function, NOT a sub-clause of the GROUP BY clause, and can only be used in the SELECT, HAVING and ORDER BY clauses.

    See http://msdn.microsoft.com/en-us/library/bb510624.aspx.

  • Warren Gilbert (10/1/2009)


    I am also of the opinion that the answer is incorrect.

    The question specifically asks for extensions (subclauses) to the GROUP BY clause.

    GROUPING_ID is a function, NOT a sub-clause of the GROUP BY clause, and can only be used in the SELECT, HAVING and ORDER BY clauses.

    See http://msdn.microsoft.com/en-us/library/bb510624.aspx.

    i'm with you on this

    Life: it twists and turns like a twisty turny thing

  • Mighty (10/1/2009)


    I'm of the opinion that the answer(s) are incorrect.

    CUBE and ROLLUP where already available in SQL Server 2005, so they were not introduced with SQL Server 2008.

    SQL Server 2005 and before supported WITH CUBE and WITH ROLLUP. These are now deprecated since they can be replaced by using GROUPING SETS with the new CUBE and ROLLUP functions.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • Hugo Kornelis (10/1/2009)


    Mighty (10/1/2009)


    I'm of the opinion that the answer(s) are incorrect.

    CUBE and ROLLUP where already available in SQL Server 2005, so they were not introduced with SQL Server 2008.

    SQL Server 2005 and before supported WITH CUBE and WITH ROLLUP. These are now deprecated since they can be replaced by using GROUPING SETS with the new CUBE and ROLLUP functions.

    In BOL 2005 when they describe the arguments they don't mention the WITH. But if I follow your reasoning, then the correct way of writing the answers should be CUBE() and ROLLUP(), making CUBE and ROLLUP also incorrect.

    The whole point is that the answers to the question left room for interpretation.

  • The question was "SQL Server 2008 introduces several extensions (subclauses), to the GROUP BY clause"

    GROUPING_ID is not part of the GROUP BY clause!

    If CUBE and ROLLUP were indeed part of SQL2005 then I got it wrong anyway as I thought these were new in 2008 🙁

  • I almost selected all them figuring it was a trick question. I guess that what I should have done because I missed it as well. :unsure:

    http://brittcluff.blogspot.com/

  • I totally agree that the answer is incorrect and grouping_id is not a sub-clause, the group by subclauses listed at the following link http://technet.microsoft.com/en-us/library/ms177673.aspx did not list Grouping_ID as a sub_clause. It is treated more like an aggregate, because the columns in the function/aggregate must appear in the group by clause with a sub-clause, see http://technet.microsoft.com/en-us/library/bb510624.aspx.

    :hehe:

    Rick Karpel

  • I agree, in my opinion GROUPING_ID belongs to the SELECT clause, not the GROUP BY clause.

  • Warren Gilbert (10/1/2009)


    I am also of the opinion that the answer is incorrect.

    The question specifically asks for extensions (subclauses) to the GROUP BY clause.

    GROUPING_ID is a function, NOT a sub-clause of the GROUP BY clause, and can only be used in the SELECT, HAVING and ORDER BY clauses.

    See http://msdn.microsoft.com/en-us/library/bb510624.aspx.

    I agree

  • I agree as well that GROUPING_ID is not a sub clause of GROUP BY.

  • Mighty (10/1/2009)


    I'm of the opinion that the answer(s) are incorrect.

    CUBE and ROLLUP where already available in SQL Server 2005, so they were not introduced with SQL Server 2008.

    I'll add my vote that the answer is incorrect. What has changed in SQL Server 2008 is the syntax. Per the BOL:

    The GROUP BY clause has an ISO-compliant syntax and a non-ISO-compliant syntax. Only one syntax style can be used in a single SELECT statement. Use the ISO compliant syntax for all new work. The non-ISO compliant syntax is provided for backward compatibility.


    [font="Arial Narrow"](PHB) I think we should build an SQL database. (Dilbert) What color do you want that database? (PHB) I think mauve has the most RAM.[/font]

  • Mighty (10/1/2009)


    I'm of the opinion that the answer(s) are incorrect.

    CUBE and ROLLUP where already available in SQL Server 2005, so they were not introduced with SQL Server 2008.

    CUBE and ROLLUP are older. They started at least with SQL Server 2000.

Viewing 15 posts - 1 through 15 (of 45 total)

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