You are viewing a single comment's thread. Return to all comments →
shorter and cleaner query:
SELECT s.name
FROM friends f
JOIN students s ON s.id = f.id
JOIN packages p ON p.id = f.id JOIN packages p2 ON p2.id = f.friend_id
WHERE p2.salary > p.salary ORDER BY p2.salary;
Seems like cookies are disabled on this browser, please enable them to open this website
Placements
You are viewing a single comment's thread. Return to all comments →
shorter and cleaner query:
SELECT s.name
FROM friends f
JOIN students s ON s.id = f.id
JOIN packages p ON p.id = f.id JOIN packages p2 ON p2.id = f.friend_id
WHERE p2.salary > p.salary ORDER BY p2.salary;