SELECT DISTINCT
T1.PeriodDate
, (
SELECT
COUNT(*)
FROM
(
select distinct
PeriodDate
from
TABLE1
) as N2
WHERE
N2.PeriodDate >= T1.PeriodDate
) AS
Rank
FROM
TABLE1 AS T1
ORDER BY
T1.PeriodDate DESC
;
No comments:
Post a Comment