1> select browser,count(*) from logtest group by browser;
+-----------+----------+
| browser | count(*) |
+-----------+----------+
| Firefox 3 | 14 |
| Unknown | 11 |
+-----------+----------+
2 rows in set
2> select browser,count(browser) from logtest group by browser;
+-----------+----------------+
| browser | count(browser) |
+-----------+----------------+
| Firefox 3 | 14 |
| Unknown | 11 |
+-----------+----------------+
2 rows in set
3> select browser,count(browser) from logtest;
+-----------+----------------+
| browser | count(browser) |
+-----------+----------------+
| Firefox 3 | 25 |
+-----------+----------------+
1 row in set
Why the query manner 1> and 2> result in the same result? Is there nothing difference between the count(*) and count(somefiled)?
Also,whay the query 2> and 3> result in the different result,why the groupby so magic? How does it work?
UPDATE: I am using MySQL5.1. :)