You are viewing a single comment's thread. Return to all comments →
with cte as (select s.*,f.Friend_ID,p.Salary as salary,p1.salary as best_friend_salary from Students s join Friends f on s.ID=f.ID join packages p on s.ID=p.ID join packages p1 on f.Friend_ID=p1.ID where p1.salary>p.Salary) select Name from cte order by best_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 →