You are viewing a single comment's thread. Return to all comments →
My SQL:
select s.name from ( select f.id, f.friend_id, p1.Salary my_salary from friends f inner join packages p1 on f.id = p1.id ) a inner join ( select f.id, f.friend_id, p1.Salary friend_salary from friends f inner join packages p1 on f.friend_id = p1.id ) b on a.id = b.id inner join students s on s.id = a.id where a.my_salary < b.friend_salary order by b.friend_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 →
My SQL: