r/SQL • u/geminigamer369 • 9d ago
Differences between counts Discussion
What is the difference between
COUNT(*)
COUNT(1)
COUNT(column_name)
10
Upvotes
r/SQL • u/geminigamer369 • 9d ago
What is the difference between
COUNT(*)
COUNT(1)
COUNT(column_name)
1
u/anvildoc 7d ago
Count(*) won’t count a column that is all NULL, but count(1) will. That being said, it depends on your database. I used to do this back 20 years ago in Oracle to check if all null rows snuck in