I've always wondered what the difference is between these three ways of using COUNT
SQL (I also don't know if there is a difference depending on the database driver being used).
For example in MySQL, if I have a table with 100 records and I do this:
SELECT COUNT(*), COUNT(1), COUNT(columna) FROM tabla;
It throws me three columns with a correct count.
What is the difference between these three ways of using COUNT
?
Is there one of them, based on objective tests, that is more recommended or does it not matter to use any of the forms?