Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
366 B
1
Indexable
Never
select name
from
(select name,salary, friend_id, 
(select salary from students,packages where students.id = friend_id and students.id = packages.id) as student_salary
from students, packages,friends
where students.id = packages.id and students.id = friends.id
order by salary
) as output
where output.salary < output.student_salary 
order by student_salary;