You are viewing a single comment's thread. Return to all comments →
MS SQL SERVER
With CTE AS
(
Select s.Id as SID , Name, f.Friend_ID AS FID, Salary from Students s inner join Friends f on s.Id = F.Id inner join Packages p on f.ID = p.ID
)
Select b.name from CTE a
inner join CTE b on a.SID = b.FID where a.Salary > b.Salary order by a.Salary
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Placements
You are viewing a single comment's thread. Return to all comments →
MS SQL SERVER
With CTE AS
(
)
Select b.name from CTE a
inner join CTE b on a.SID = b.FID where a.Salary > b.Salary order by a.Salary