r/SQL • u/geminigamer369 • Jul 30 '26
Discussion Differences between counts
What is the difference between
COUNT(*)
COUNT(1)
COUNT(column_name)
8
Upvotes
r/SQL • u/geminigamer369 • Jul 30 '26
What is the difference between
COUNT(*)
COUNT(1)
COUNT(column_name)
View all comments
Show parent comment
2
u/ComicOzzy sqlHippo Jul 30 '26
COUNT(1) or COUNT(-123) or COUNT('banana') or COUNT('🍌') all get recognized as the same operation: a count of all rows. There is no difference between them and COUNT(*).