And next solution:
regards
Zbig
;with lot(lotNo) as (
select lotNo
FROM (VALUES('A'),('B'),('C'),('D'),('E'),('F'),('G'),('H'),('I'),('J'),('K'),('L'),('M'),('N'),('O'),('P'),('Q'),('R'),('S'),('T'),('U'),('V'),('W'),('X'),('Y'),('Z'))t(LotNo)
)
, cte02 as (
select rn = row_number() over (order by lotNo)
...