I am assuming from your email that the field ID allows duplicates. In that 
case, use the SELECT DISTINCT syntax ... that will get you back the 1 row 
you are looking for. However, if the (ID,CompetitorName) tuple is unique, 
SELECT DISTINCT will NOT help.

Hope this helps
Raj
At 06:12 PM 9/23/2001, Neil Silvester wrote:


>As I am still a newbie to mysql I am sure that some of the problems that I
>am coming accross are created by myself, and others are probably so simple
>that they are staring me in the face. I do, however, seem to be having some
>problems with the below statement.
>I would like the result of the query to only display one entry per company
>no matter how many products they have.
>
>
>$result = mysql_query("SELECT competitor.ID, Competitor.CompetitorName FROM
>competitor, competitorproducts, productcategory WHERE
>competitorproducts.CompID=competitor.ID and
>competitorproducts.CatID=productcategory.ID and productcategory.ID like
>\"$cat%\" and competitor.CompetitorName like \"$CompName%\"  and
>competitorproducts.ProductName like \"$CompProd%\" order by CompetitorName
>");
>
>I am using PHP as a front end.
>
>TIA.
>Neil Silvester
>P.S. database, mysql
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
>---------------------------------------------------------------------
>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

Thanks
Raj Datta
Professional Services                           Direct   : 408-530-4932
CrossAccess Corp                                Cell       : 408-316-5473
2900 Gordon Ave #100                       Fax       : 408-735-0328
Santa Clara CA 95051                         Email   : [EMAIL PROTECTED]


---------------------------------------------------------------------
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