Databases InterBase (28) MS-SQL (5) mysql (36) Oracle (1)
Exchange Links About this site Links to us 
|
count(*) syntax in mysql
This article has not been rated yet. After reading, feel free to leave comments and rate it.
You may be surprised to find out that there is no white space allowed between count and () in mysql queries.
Also be careful on which column you perform the count. It may not be wise to use count(*) if you have a certain index defined and you have a where condition that uses this index. You might want to replace the '*' with a column name. Read more on this bug here:
http://bugs.mysql.com/bug.php?id=14980
 | |  | | select count (*) from table1;
select count(*) from table1; | |  | |  |
Comments:
|