Good Day. So, everythign is in the title :)
I am looking to merge the result of two requests and order the result together (as in not one after the other). => I was
SELECT *
FROM (
(SELECT * FROM user_relation WHERE from_user_id = 1)
UNION
(SELECT * FROM user_relation WHERE to_user_id = 1)
) AS i
ORDER BY trust_degree
You have to assign an alias to your select. But in this case a UNION
is not necessary and could be replaced by a simple OR
, as @Karoly Horvath points out in his comment. The resulting query would look like this:
SELECT
*
FROM user_relation
WHERE from_user_id = 1 OR to_user_id = 1
ORDER BY trust_degree