Skip to content

Commit f2f4eb2

Browse files
authored
Merge pull request MicrosoftDocs#592 from fbsolo/patch-28
Update count-big-transact-sql.md
2 parents fae18f2 + 071e701 commit f2f4eb2

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

docs/t-sql/functions/count-big-transact-sql.md

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
title: "COUNT_BIG (Transact-SQL) | Microsoft Docs"
33
ms.custom: ""
44
ms.date: "07/24/2017"
@@ -33,7 +33,7 @@ monikerRange: ">= aps-pdw-2016 || = azuresqldb-current || = azure-sqldw-latest |
3333
# COUNT_BIG (-SQL)
3434
[!INCLUDE[tsql-appliesto-ss2008-all-md](../../includes/tsql-appliesto-ss2008-all-md.md)]
3535

36-
Returns the number of items in a group. COUNT_BIG works like the COUNT function. The only difference between the two functions is their return values. COUNT_BIG always returns a **bigint** data type value. COUNT always returns an **int** data type value.
36+
This function returns the number of items found in a group. `COUNT_BIG` operates like the [COUNT](../../t-sql/functions/count-transact-sql.md) function. These functions differ only in the data types of their return values. `COUNT_BIG` always returns a **bigint** data type value. `COUNT` always returns an **int** data type value.
3737

3838
![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
3939

@@ -58,43 +58,34 @@ COUNT_BIG ( { expression | * } ) OVER ( [ <partition_by_clause> ] )
5858

5959
## Arguments
6060
ALL
61-
Applies the aggregate function to all values. ALL is the default.
61+
Applies the aggregate function to all values. ALL serves as the default.
6262

6363
DISTINCT
64-
Specifies that COUNT_BIG returns the number of unique nonnull values.
64+
Specifies that `COUNT_BIG` returns the number of unique nonnull values.
6565

6666
*expression*
67-
Is an [expression](../../t-sql/language-elements/expressions-transact-sql.md) of any type. Aggregate functions and subqueries are not permitted.
67+
An [expression](../../t-sql/language-elements/expressions-transact-sql.md) of any type. Note that `COUNT_BIG` does not support aggregate functions or subqueries in an expression.
6868

6969
*\**
70-
Specifies that all rows should be counted to return the total number of rows in a table. COUNT_BIG(*\**) takes no parameters and cannot be used with DISTINCT. COUNT_BIG(*\**) does not require an *expression* parameter because, by definition, it does not use information about any particular column. COUNT_BIG(*\**) returns the number of rows in a specified table without getting rid of duplicates. It counts each row separately. This includes rows that contain null values.
71-
72-
ALL
73-
Applies the aggregate function to all values. ALL is the default.
74-
75-
DISTINCT
76-
Specifies that AVG be performed only on each unique instance of a value, regardless of how many times the value occurs.
77-
78-
*expression*
79-
Is an [expression](../../t-sql/language-elements/expressions-transact-sql.md) of the exact numeric or approximate numeric data type category, except for the **bit** data type. Aggregate functions and subqueries are not permitted.
70+
Specifies that `COUNT_BIG` should count all rows to determine the total table row count to return. `COUNT_BIG(*)` takes no parameters and does not support the use of DISTINCT. `COUNT_BIG(*)` does not require an *expression* parameter because by definition, it does not use information about any particular column. `COUNT_BIG(*)` returns the number of rows in a specified table, and it preserves duplicate rows. It counts each row separately. This includes rows that contain null values.
8071

8172
OVER **(** [ *partition_by_clause* ] [ *order_by_clause* ] **)**
82-
*partition_by_clause* divides the result set produced by the FROM clause into partitions to which the function is applied. If not specified, the function treats all rows of the query result set as a single group. *order_by_clause* determines the logical order in which the operation is performed. For more information, see [OVER Clause &#40;Transact-SQL&#41;](../../t-sql/queries/select-over-clause-transact-sql.md).
73+
The *partition_by_clause* divides the result set produced by the `FROM` clause into partitions to which the `COUNT_BIG` function is applied. If not specified, the function treats all rows of the query result set as a single group. The *order_by_clause* determines the logical order of the operation. See [OVER Clause &#40;Transact-SQL&#41;](../../t-sql/queries/select-over-clause-transact-sql.md) for more information.
8374

8475
## Return types
8576
**bigint**
8677

8778
## Remarks
88-
COUNT_BIG(*) returns the number of items in a group. This includes NULL values and duplicates.
79+
COUNT_BIG(\*) returns the number of items in a group. This includes NULL values and duplicates.
8980

90-
COUNT_BIG (ALL *expression*) evaluates *expression* for each row in a group and returns the number of nonnull values.
81+
COUNT_BIG (ALL *expression*) evaluates *expression* for each row in a group, and returns the number of nonnull values.
9182

92-
COUNT_BIG (DISTINCT *expression*) evaluates *expression* for each row in a group and returns the number of unique, nonnull values.
83+
COUNT_BIG (DISTINCT *expression*) evaluates *expression* for each row in a group, and returns the number of unique, nonnull values.
9384

94-
COUNT_BIG is a deterministic function when used without the OVER and ORDER BY clauses. It is nondeterministic when specified with the OVER and ORDER BY clauses. For more information, see [Deterministic and Nondeterministic Functions](../../relational-databases/user-defined-functions/deterministic-and-nondeterministic-functions.md).
85+
COUNT_BIG is a deterministic function when used ***without*** the OVER and ORDER BY clauses. It is nondeterministic when used ***with*** the OVER and ORDER BY clauses. See [Deterministic and Nondeterministic Functions](../../relational-databases/user-defined-functions/deterministic-and-nondeterministic-functions.md) for more information.
9586

9687
## Examples
97-
For examples, see [COUNT &#40;Transact-SQL&#41;](../../t-sql/functions/count-transact-sql.md).
88+
See [COUNT &#40;Transact-SQL&#41;](../../t-sql/functions/count-transact-sql.md) for examples.
9889

9990
## See also
10091
[Aggregate Functions &#40;Transact-SQL&#41;](../../t-sql/functions/aggregate-functions-transact-sql.md)

0 commit comments

Comments
 (0)