{"id":148,"date":"2012-04-16T12:54:58","date_gmt":"2012-04-16T12:54:58","guid":{"rendered":"https:\/\/sqlserverlearner.azurewebsites.net\/2012\/04\/16\/what-are-the-maximum-number-of-columns-in-group-by-clause-in-sql-server\/"},"modified":"2012-04-16T12:54:58","modified_gmt":"2012-04-16T12:54:58","slug":"what-are-the-maximum-number-of-columns-in-group-by-clause-in-sql-server","status":"publish","type":"post","link":"https:\/\/sqlserverlearner.com\/2012\/04\/16\/what-are-the-maximum-number-of-columns-in-group-by-clause-in-sql-server\/","title":{"rendered":"What are the maximum number of Columns in GROUP BY clause in SQL Server?"},"content":{"rendered":"

table.hovertable {
\nfont-family: verdana,arial,sans-serif;
\nfont-size:11px;
\ncolor:#333333;
\nborder-width: 1px;
\nborder-color: #999999;
\nborder-collapse: collapse;
\n}
\ntable.hovertable th {
\nbackground-color:#c3dde0;
\nborder-width: 1px;
\npadding: 8px;
\nborder-style: solid;
\nborder-color: #a9c6c9;
\n}
\ntable.hovertable tr {
\nbackground-color:#d4e3e5;
\n}
\ntable.hovertable td {
\nborder-width: 1px;
\npadding: 8px;
\nborder-style: solid;
\nborder-color: #a9c6c9;
\n}<\/p>\n

What are the maximum number of Columns in GROUP BY clause in SQL Server?<\/b>
\nThe maximum number of Columns in GROUP BY clause are limited only by number of bytes.<\/p>\n

Below link gives details regarding maximum bytes per Group By Clause.
\nWhat are the maximum Bytes per GROUP BY in SQL Server?<\/a>
\n
\nWhat are the maximum number of Columns or expressions in GROUP BY WITH CUBE in SQL Server?<\/b>
\nThe maximum number of Columns or expressions in GROUP BY WITH CUBE is 10 .<\/p>\n

What are the maximum number of Columns or expressions in GROUP BY WITH ROLLUP in SQL Server?<\/b>
\nThe maximum number of Columns or expressions in GROUP BY WITH ROLLUP is 10 .<\/p>\n\n\n\n\n\n\n
Max Capacity For<\/th>\nSQL Server 2012<\/th>\nSQL Server 2008 R2<\/th>\nSQL Server 2008<\/th>\nSQL Server 2005<\/th>\n<\/tr>\n
\nmaximum number of Columns in GROUP BY clause in SQL Server\n<\/td>\n\nLimited only by number of bytes.\n<\/td>\n\nLimited only by number of bytes.\n<\/td>\n\nLimited only by number of bytes.\n<\/td>\n\nLimited only by number of bytes.\n<\/td>\n<\/tr>\n
\nMaximum number of Columns or expressions in GROUP BY WITH CUBE\n<\/td>\n\n10\n<\/td>\n\n10\n<\/td>\n\n10\n<\/td>\n\n10\n<\/td>\n<\/tr>\n
\nMaximum number of Columns or expressions in GROUP BY WITH ROLLUP\n<\/td>\n\n10\n<\/td>\n\n10\n<\/td>\n\n10\n<\/td>\n\n10\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\nhttp:\/\/msdn.microsoft.com\/en-us\/library\/ms143432.aspx<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

table.hovertable { font-family: verdana,arial,sans-serif; font-size:11px; color:#333333; border-width: 1px; border-color: #999999; border-collapse: collapse; } table.hovertable th { background-color:#c3dde0; border-width: 1px; padding: 8px; border-style: solid; border-color: #a9c6c9; } table.hovertable tr { background-color:#d4e3e5; } table.hovertable td { border-width: 1px; padding: 8px; border-style: solid; border-color: #a9c6c9; } What are the maximum number of Columns in GROUP BY clause in…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[1418,1419,1420,1421,1422,1423,1424,1425,1426,1427,1428,1429,1430,1431,1432,1433,1434,1435,1436,1437],"_links":{"self":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts\/148"}],"collection":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/comments?post=148"}],"version-history":[{"count":0,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts\/148\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/media?parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/categories?post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/tags?post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}