Subquery inside "IN" Clause

mysql, sql, subquery

Solution

This could be done using `JOIN`. Below is an example using the implicit short-hand syntax.

SELECT * FROM image_appreciations a, images i
WHERE a.image_id = i.id AND i.user_id = 1

Problem

``` SELECT * FROM `image_appreciations` WHERE `image_id` IN(SELECT `id` FROM `images` WHERE `user_id` = '1') ``` Is my current query, it returns zero results ``` SELECT `id` FROM `images` WHERE `user_id` = '1' ``` being the subquery returns around 8 id's which two of them are found in ``` SELECT * FROM `image_appreciations` WHERE `image_id` IN(77,89) ``` And that works fine. But all together it fails. What am i doing wrong?

Original source