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
1
u/Infamous_Welder_4349 Jul 30 '26
I use use an Oracle 19 database with 6-7 Billion records. Count 1 does the same as count . For simple single table counts it doesn't take the time, it gives me an answer that matches what the statistics say. If I say count () where or if I pick the primary field then it counts and might take a minute or two to answer.
Remember different database do different things. Even Oracle with different settings will behave differently.