Le mardi 24 janvier 2006 à 19:23 +0100, Fabien SK a écrit :
> Le mardi 24 janvier 2006 à 19:08 +0100, fabsk a écrit :
> > Thank you a lot for your answer. The bug is there: if I drop the index
> > 'tp_idx_part_solution', the result of the count is OK.
> > I recreated this index and the cound drop
Le mardi 24 janvier 2006 à 19:08 +0100, fabsk a écrit :
> Thank you a lot for your answer. The bug is there: if I drop the index
> 'tp_idx_part_solution', the result of the count is OK.
> I recreated this index and the cound drop to "2" again.
It doesn't happen on version 4.1.12-Max on my machine
Le mardi 24 janvier 2006 à 09:19 +0100, Martijn Tonies a écrit :
>> CREATE TABLE `tp_participation` (
>> `uid` int(11) NOT NULL default '0',
>> `challenge_id` int(11) NOT NULL default '0',
>> `response` text collate latin1_general_ci NOT NULL,
>> `points` int(11) default NULL,
>> UNIQUE K
> Thank you a lot for your answer. I checked very carefully. The structure
> of the table is (exported by phpMyAdmin):
>
> CREATE TABLE `tp_participation` (
> `uid` int(11) NOT NULL default '0',
> `challenge_id` int(11) NOT NULL default '0',
> `response` text collate latin1_general_ci NOT NU
that
> you aren't inadvertently writing the query incorrectly and that you really
> DO have 10 rows with cid = 123. If you still get 2 as the result of your
> query, I would recommend sending a bug report to MySQL.
>
> Rhino
>
> - Original Message -
> Fro
My guess would that your PHP code is not written correctly.
For instance, if you have a query in PHP:
$sql="select * from my_table where cid=123";
...and are using the PHP function mysql_numrows() to count the
results, and then for your next test... you're just changing the query
to:
$sql="sele
fabsk wrote:
> Hi,
>
> I'm facing a strange problem. I am using a database at my Internet
> provider (Free, France). The type of table is MyISAM (no choice), MySQL
> 4.1.15. I can do my tests with my PHP code or phpMyAdmin.
>
> The definition of my table is:
> - uid, int
> - cid, int
> - response,
o
- Original Message -
From: "fabsk" <[EMAIL PROTECTED]>
To:
Sent: Monday, January 23, 2006 5:32 PM
Subject: Re: count(*) send a wrong value
Thank you for you answer, but I read many times and I did not found
something to answer my question (well, I did not know about the NUL
Thank you for you answer, but I read many times and I did not found
something to answer my question (well, I did not know about the NULL).
In my case:
- there is one table
- htere is no "distinct"
- there is a WHERE clause, so there is no optimisation
- there is no other field and no "group by"
I
Thank you for you answer, but I read many times and I did not found
something to answer my question (well, I did not know about the NULL).
In my case:
- there is one table
- htere is no "distinct"
- there is a WHERE clause, so there is no optimisation
- there is no other field and no "group by"
I
>From the MySQL 4.1 manual
12.10.1. GROUP BY (Aggregate) Functions
COUNT(expr)
Returns a count of the number of non-NULL values in the rows
retrieved by a SELECT statement.
COUNT() returns 0 if there were no matching rows.
mysql> SELECT student.student_name,COUNT(*)
->FROM st
11 matches
Mail list logo