difference between count(*) and count(field)
What is the difference between “select count(*) from sometable” and “select count(somefield) from sometable”?
What is the difference between “select count(*) from sometable” and “select count(somefield) from sometable”?
You must be logged in to post a comment.
select count(*) returns the count of all records in a table.
select count(somefield) returns the number of records where somefield is not NULL
In tables where somefield is never NULL, the results will be the same.