MySQL Forums
Forum List  »  General

Wrong count(*)
Posted by: larry
Date: November 15, 2005 07:19AM

mysql> select count(*) from vote where model=49;
+----------+
| count(*) |
+----------+
| 2 |
+----------+
1 row in set (0.00 sec)

mysql> select count(id) from vote where model=49;
+-----------+
| count(id) |
+-----------+
| 4 |
+-----------+
1 row in set (0.00 sec)

mysql> select * from vote where model=49;
+-----+-------+---------------+
| id | model | login |
+-----+-------+---------------+
| 228 | 49 | <b>Script</b> |
| 229 | 49 | <b>Script</b> |
| 332 | 49 | <b>Script</b> |
| 333 | 49 | <b>Script</b> |
+-----+-------+---------------+
4 rows in set (0.00 sec)

mysql> show create table vote;
+-------+-------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-------------------------------------+
| Table | Create Table

|
+-------+-------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-------------------------------------+
| vote | CREATE TABLE `vote` (
`id` int(11) NOT NULL auto_increment,
`model` int(11) NOT NULL default '0',
`login` text NOT NULL,
PRIMARY KEY (`id`),
KEY `model_2` (`model`,`login`(32))
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-------------------------------------+
1 row in set (0.00 sec)

mysql>

server version: 4.1.14

I guess no further explanations are needed.
Made repair table and myisamchk several times with different options – doesn’t solved.

Or I am deeply wrong somewhere, but I can’t find out.

Options: ReplyQuote


Subject
Written By
Posted
Wrong count(*)
November 15, 2005 07:19AM
November 16, 2005 04:18AM
November 16, 2005 04:54AM
November 16, 2005 05:05AM
November 16, 2005 05:19AM
November 16, 2005 06:44AM
November 16, 2005 12:59PM
April 12, 2006 01:48PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.