INNER JOIN goes crazy


I have table with articles


ID | Name | category_id

and other table with article attributes:


ID | Attribute | article_id


What i need is to select all articles WHERE category_id=‘5’ AND Attribute=‘1024x768’

Can anyone please help me with this?! Thank you!!

Try this

SELECT FROM articles art
LEFT JOIN attributes attr on attr.article_id =
WHERE art.category_id='5' AND attr.Attribute='1024x768'
SELECT articles.ID
     , articles.Name
  FROM articles 
  JOIN attributes 
    ON attributes.article_id = articles.ID
   AND attributes.Attribute = '1024x768'
 WHERE articles.category_id = 5

philip, your LEFT OUTER JOIN will behave exactly like an inner join because you have a non-NULL condition in the WHERE clause

Thank you much! I have tryed this and it works i need now to test more but i think this is what i need. Thank you!!!