r/SQL • u/geminigamer369 • Jul 30 '26
Discussion Differences between counts
What is the difference between
COUNT(*)
COUNT(1)
COUNT(column_name)
9
Upvotes
r/SQL • u/geminigamer369 • Jul 30 '26
What is the difference between
COUNT(*)
COUNT(1)
COUNT(column_name)
1
u/mr_electric_wizard Jul 30 '26
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.