MySQL查询只返回一行[关闭]

Any ideas why this query only return a single row?

SELECT c.category_id, c.parent_id, cd.name, cd.description 
FROM mydb_category c 
LEFT JOIN mydb_category_description cd 
ON (c.category_id = cd.category_id) 
WHERE c.category_id IN ('46,59') 
AND c.status        = '1' 
AND cd.language_id  = '1'

The language_id is correct, the status is correct, but for some reason I'm only getting the row with category_id 46 returned.

Remove the quotes in IN('46,49') so your query look like this:

SELECT 
    c.category_id, c.parent_id, cd.name, cd.description
FROM
    mydb_category c
        LEFT JOIN
    mydb_category_description cd ON (c.category_id = cd.category_id)
WHERE
    c.category_id IN (46,59)
        AND c.status = '1'
        AND cd.language_id = '1'

Se the documentation for more info. Good luck!