Group by multiple column acquired from join
You can do this using COALESCE. If table1.user_id is null then it will use table2.user_id. If that is null then it uses table3.user_id and so on.

SELECT COALESCE(table1.user_id, table2.user_id, table3.user_id) AS `xx_user_id`
FROM ...table joins...
GROUP BY `xx_user_id`


You won't be able to use the derived xx_user_id column in a WHERE clause however you can use it in a HAVING clause

SELECT COALESCE(table1.user_id, table2.user_id, table3.user_id) AS `xx_user_id`
FROM ...table joins...
GROUP BY `xx_user_id`
HAVING `xx_user_id` = 123;