Pages

Monday, September 22, 2014

COUNT_BIG() is for counting big range TIP #50

 

Problem:- How to count large number of rows for specific condition ?

Solution

Suppose you have a large table which having more than millions of records and you want to count no of rows for specific condition  which itself contain more than 100 millions records.

Now in this case when we use COUNT function then we will get arithmetic overflow error message.

Now in such situation we have another function which can count this big ranges specially numeric data types.

The use of this is similar as COUNT function

For example you have to write

SELECT COUNT_BIG(1) FROM  tblMyLargeTable

I hope it may help you some time Smile

Thanks & Enjoy

RJ !!!

No comments:

Post a Comment