You are viewing a single comment's thread. Return to all comments →
This query is about unifying the results of two subqueries, so we use the UNION clause.
The WHERE ROWNUM = 1 in both subqueries is there in order to do a "TOP 1". That is the way this is done in Oracle. It is not very didactic but that's how Oracle undestands it. A simple explanation for that is here: https://stackoverflow.com/questions/3451534/how-do-i-do-top-1-in-oracle
The reason of what I have put in the ORDER BY, I think it is due to the statement of the challenge, but I'd have to look into it again.
All the best!