Friday, August 2, 2019

Differences between count(1) and count(*)

COUNT(1) is faster than COUNT(*).

COUNT(*) takes all columns to count rows and COUNT(1) counts using the first column

COUNT (<expression>)

COUNT function counts all of not empty (non-null) occurrences of expression <expression>.

COUNT(1) is nothing other than COUNT(<expression>) where the Expression = 1 => and „1” is obviously not null.

COUNT(*)

There is not too much to explain – it just counts all records in table.

For Example

EMP Table Data.


select count(*) , count(1),count(comm)  from emp




No comments:

Post a Comment

AME (Approval Management Engine)

AME (Approval Management Engine) : AME Stands for Oracle Approval Management Engine. AME is a self service web application that enables...