Major difference between COUNT(column_name) and COUNT(*)
Posted: Thu Oct 18, 2012 5:53 pm
For example if I wanted to count elements in a specific table
I can use
[syntax=sql]SELECT COUNT(user_id) FROM `users`[/syntax]
and
[syntax=sql]SELECT COUNT(user_id) FROM `users`
[/syntax]
the give the same number but what are the main differences between them?
I can use
[syntax=sql]SELECT COUNT(user_id) FROM `users`[/syntax]
and
[syntax=sql]SELECT COUNT(user_id) FROM `users`
[/syntax]
the give the same number but what are the main differences between them?