Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
171 B
2
Indexable
Never
SELECT Name FROM students S JOIN friends A ON S.id = A.id JOIN packages P ON A.id = P.id JOIN packages Q ON A.friend_id = Q.id
WHERE P.salary < Q.salary ORDER BY Q.salary;