SELECT f1.user_id, f1.friend_id FROM
friends_info f1
WHERE f1.user_id = 1 OR
f1.user_id IN
(
select f2.friend_id
from friends_info f2
where f2.user_id = 1
)
ORDER BY user_id
SELECT f1.user_id, f1.friend_id FROM
friends_info f1
WHERE f1.user_id = 1 OR
f1.user_id IN
(
select f2.friend_id
from friends_info f2
where f2.user_id = 1
)
ORDER BY user_id