You are viewing a single comment's thread. Return to all comments →
with cte_stu as( select F.ID,s.name,P.Salary from Friends F join Packages P on F.ID=P.ID join Students s on F.ID=s.ID),
cte_fri as( select F.Friend_ID,s.name,P.Salary from Friends F join Packages P on Friend_ID=P.ID join Students s on Friend_ID=s.ID)
Select st.name from cte_stu St join Friends F on ST.ID=F.ID join cte_fri fr on fr.Friend_ID=F.Friend_ID where Fr.salary > st.Salary order by fr.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 →
with cte_stu as( select F.ID,s.name,P.Salary from Friends F join Packages P on F.ID=P.ID join Students s on F.ID=s.ID),
Select st.name from
cte_stu St join Friends F on ST.ID=F.ID join cte_fri fr on fr.Friend_ID=F.Friend_ID where Fr.salary > st.Salary order by fr.salary