I have to select all posts posted by the users listed in my SUBQUERY - SUBQUERY is a table with only one column - user IDs. The purpose is to get all posts of user's "friends"
I have a misty memory that you can use IN
on SELECT
but the SELECT
's result can only be one column only - am I right?
So this query:
SELECT * FROM posts WHERE id_user
IN (SELECT id_friend as id_user FROM friends WHERE id_user=:some_id_user)
Can it be done? If so, is there a more efficient way?
BTW: I am using MySQL