Điều này nên làm:
SELECT rank() OVER (ORDER BY WL.LastName, WL.FirstName) as rank, WL.LastName, WL.FirstName
FROM @tblWaitList WL
INNER JOIN @tblSeminar S
ON WL.SeminarGuid=S.SeminarGuid
WHERE S.SeminarID = @SeminarID AND S.SeminarType = @SeminarType
ORDER BY rank ;