Skip navigation links

MySQL Forums :: General :: Wrong count(*)


Advanced Search

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(*) larry 11/15/2005 07:19AM
Re: Wrong count(*) larry 11/16/2005 04:18AM
Re: Wrong count(*) Felix Geerinckx 11/16/2005 04:54AM
Re: Wrong count(*) larry 11/16/2005 05:05AM
Re: Wrong count(*) Felix Geerinckx 11/16/2005 05:19AM
Re: Wrong count(*) Felix Geerinckx 11/16/2005 06:44AM
Re: Wrong count(*) larry 11/16/2005 12:59PM
Re: Wrong count(*) James Day 04/12/2006 01:48PM


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