Hi,
the following query yields:
mysql> SELECT DISTINCT (@c:=@c+1), p.*,
count(k.keywords) AS found FROM keywords k, poll_keywords pk, poll p ,
section_poll sp WHERE 1 AND k.keywords IN ('quarto') AND
k.id_keyword=pk.id_keyword AND pk.id_poll=p.id_poll AND sp.id_section IN
(29, 0, 1, 2, 3, 4, 5, 995, 20, 996, 13, 7, 997, 30, 14, 15, 23, 16, 24,
17, 25, 34, 18, 26, 35, 19, 27, 28) AND sp.id_poll=p.id_poll GROUP BY
p.id_poll, id_section having found=1 ORDER BY p.id_poll LIMIT 0,5;
+------------+---------------------+--------+-------------------+-----------------------+-----------------------------------------------+----------------+--------+---------------+--------------+--------------+--------------+-------------+-----------------
+----------------+---------+-----------------+----------------+-------------+------+-------------+-----------+---------------+-------------------------------------------+--------------------------------------------------+--------------+------------------+
-------+-----------+--------------------+-------+ | (@c:=@c+1) | id_poll |
author | title | abstract | question
| authentication | groups | id_created_by | created_when |
stop_showing | begin_voting | stop_voting | id_published_by |
published_when | suspend | id_suspended_by | suspended_when | answer_type
| open | periodicity | vote_type | homepage_flag | question_img_src |
poll_img_src | poll_img_alt | question_img_alt | start | is_online |
update_online_when | found |
+------------+---------------------+--------+-------------------+-----------------------+-----------------------------------------------+----------------+--------+---------------+--------------+--------------+--------------+-------------+-----------------
+----------------+---------+-----------------+----------------+-------------+------+-------------+-----------+---------------+-------------------------------------------+--------------------------------------------------+--------------+------------------+
-------+-----------+--------------------+-------+ | 15 |
poll-994344433-1462 | nico | singolo, immagine | abstract secondo poll |
domanda domandona: perché non va l'answerona? | NULL | | nico | 994414142
| 999528420 | 994344420 | 996936420 | NULL
| 994414142 | 0 | NULL | NULL | 3 | 0 | 0 | 2 |
1 | /online/images/2001/21-25_05/Image196.jpg |
/online/images/2001/14-18_05/cinemaitaliano2.jpg | NULL | NULL
| 0 | 1 | 994414142 | 1 |
^^^^^^
^^^^^^ (only this result counts to me)
-+--------+-------------------+-----------------------+-----------------------------------------------+----------------+--------+---------------+--------------+--------------+--------------+-------------+-----------------+----------------+---------+-----------------+----------------+-------------+------+-------------+-----------+---------------+-------------------------------------------+--------------------------------------------------+--------------+------------------+
-------+-----------+--------------------+-------+
1 row in set (0.01 sec)
but when I modify with "having found>1", (or having found=2 after having added a
keyword in the list)
Mysql says:
ERROR 1032: Can't find record in '#sql51e9_442_18'
Is this an Innodb bug or what else?
Thanks
Nico
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php