You are viewing a single comment's thread. Return to all comments →
SQL Code -
select a.name from (select s.name as name, s.id as id, p.salary as salary from students as s join friends as f on s.id=f.id join packages as p on s.id=p.id) as a join (select s.id as id, p.salary as salary from students as s join friends as f on s.id=f.id join packages as p on f.friend_id=p.id) as b on a.id = b.id where a.salary<b.salary order by b.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 →
SQL Code -