[HR] Placements*

yozzum·2022년 9월 18일

SQL

목록 보기
13/36
select t1.name
from (
    select s.id
          ,s.name
          ,p.salary
    from students s
    inner join packages p
    on s.id = p.id
) t1
inner join (
    select f.id
          ,f.friend_id
          ,p.salary
    from friends f
    inner join packages p
    on f.friend_id = p.id
) t2
on t1.id = t2.id
where t1.salary < t2.salary
order by t2.salary asc
profile
yozzum

0개의 댓글