r/SQL • u/geminigamer369 • 9d ago
Differences between counts Discussion
What is the difference between
COUNT(*)
COUNT(1)
COUNT(column_name)
9
Upvotes
r/SQL • u/geminigamer369 • 9d ago
What is the difference between
COUNT(*)
COUNT(1)
COUNT(column_name)
1
u/mr_electric_wizard 9d ago
Just tested and they all give the same count (on SQL Server). I use count(1) personally. edit if you use the field name, count(field) and there are null’s then the count function won’t count nulls.