How to use DB2 COUNT_BIG

01 May,2015 by Jack Vamvas

Question: How is the function COUNT_BIG() used and what is the difference with COUNT()?

Answer: Both COUNT(*) and COUNT_BIG(*)  return total number of rows in a table where the value of the column is NOT NULL.

The difference is COUNT(*) returns INT datatype and COUNT_BIG(* )  uses the bigint datatype

When to use COUNT_BIG? If you think the result count is greater than the  maximum value of integer

Read more on data types

DB2 enforcing business rules on data - DBA DB2 - DBA-DB2.com

DB2 Database objects overviews - DBA DB2

How to use large BLOB/CLOB in HADR - DBA DB2

Author: Jack Vamvas(http://www.dba-db2.com)

Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on How to use DB2 COUNT_BIG

Comments are moderated, and will not appear until the author has approved them.


dba-db2.com | DB2 Performance Tuning | DBA DB2:Everything | FAQ | Contact | Copyright