I got this sql query:
SELECT *
FROM groups
LEFT OUTER JOIN group_questions
ON groups.id = group_questions.group_id
WHERE group_questions.group_id = 1 ORDER BY group_questions.id DESC
UNION
SELECT *
FROM groups
RIGHT OUTER JOIN group_questions
ON groups.id = group_questions.group_id
WHERE group_questions.group_id = 1 ORDER BY group_questions.id DESC
I'm trying to order it by doing this ORDER BY group_questions.id DESC
like in the example above. But when I add it to the query it doesn't work at all. I've tried to search for an example but was unable to find one. Anyone here got an idea?