MSDN의 CTE 페이지
with ranking_cte(login_no, rank_no) as
(
select login_no ,rank() over (order by score desc, ranking_reg_date asc) as rank_no from dbo.Ranking
)
select
idx
,[ranking_reg_date]
,cte.rank_no
from dbo.Ranking as a
inner join ranking_cte as cte
on a.login_no = cte.login_no
where a.[login_no] = 100 ;