I am new to this database SQL language so I will try to make it as simple as possible. (I am using MySQL Workbench)
I have a table for User and I want multiple users to
Use UNION ALL to get all friends, parameterize this query:
UNION ALL
select friend_user_id as friend_id from friends f where f.user_id = 2 --parameter union all select user_id as friend_id from friends f where f.friend_user_id = 2 --parameter