mysql query is producing more results than it should

Posted by user253530 on Stack Overflow See other posts from Stack Overflow or by user253530
Published on 2010-03-19T00:05:42Z Indexed on 2010/03/19 0:11 UTC
Read the original article Hit count: 620

Filed under:
|
|
SELECT S.CLIENT,S.IP_DOMAIN as IP, IFNULL(K.DATE, DATE '0000-00-00') AS RecentDate
      FROM PLD_SERVERS AS S JOIN PLD_SEARCHES AS K ON S.ID = K.SERVER_ID

This query will produce as many results as entries in the PLD_SEARCHES. For example:

I have 3 entries in PLD_SERVERS and 18 entries in PLD_SEARCHES. The output of this query will be 18 but i need it to be 3 (as the number of PLD_SERVERS entries) with the recent date as a join field from PLD_SEARCHES.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about sql