Pending friend request query for friends table and grabbing data from other tables
问题 To get pending request for selected user I use: SELECT f1.asker_user_id AS friend_id FROM friends AS f1 LEFT JOIN friends AS f2 ON f1.asked_user_id = f2.asker_user_id AND f1.asker_user_id = f2.asked_user_id WHERE f1.status = 1 AND f2.status IS NULL AND f1.asked_user_id = 2 http://www.sqlfiddle.com/#!2/0f7a0d5/65 It correctly returns user 3. VALUES (3,2,1) But I'd like to get more data about this user 3. I need name_surname and avatar from users table. And all word_id s of this user from