HI,
 I have the following table:


 desc keywords_news;
 +------------+----------+------+-----+---------+-------+
 | Field      | Type     | Null | Key | Default | Extra |
 +------------+----------+------+-----+---------+-------+
 | id_keyword | int(11)  |      | PRI | 0       |       |
 | id_news    | char(32) |      | PRI |         |       |
 +------------+----------+------+-----+---------+-------+

with primary key on the couple (id_keyword, id_news).

When I launch:

 select distinct kn.id_keyword, k.keywords  from news n, keywords_news kn, keywords k
 where (kn.id_news=n.id_news)
                        and (n.id_news='news-965409279-1907') and
                         kn.id_keyword=k.id_keyword;


 I obtain

+------------+--------------+
 | id_keyword | keywords     |
 +------------+--------------+
 |         13 | la           |
 |        107 | in           |
 |        194 | ragazzi      |
 |        195 | h            |
 |        196 | arrivo       |
 |        197 | pop-music! |
 +------------+--------------+


 and when I remove 'DISTINCT' from the query  the result is:

 Empty set (0.00 sec)

 It seems a bug, I should obtain duplicated couples without DISTINCT, right?

 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

Reply via email to