Thursday , April 25 2024

COUNT_BIG Function in SQL Server(TSQL)

 

The COUNT_BIG function performs the same function as the COUNT function. The only difference is that the COUNT_BIG function returns the BIGINT value while the COUNT function returns int value.

Let’s make examples for a better understanding of COUNT_BIG Function.

Example:

First, we create a table with the help of the following script and add a few records into this table.

Let’s calculate the number of records in the table with one of the following queries: (Both queries return the same result. If you type a column name instead of 1 or *, null records are not calculated.)

or

Calculate how many products each person has by grouping table by [Name] column:

Loading

About dbtut

We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories