;with digits(i) as
(select i
from (values(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) as digits(i)
)
,sqeuence(d1,d2,d3) as (
select d1.i as d1i,d2.i as d2i,d1.i+(10*d2.i) as d3
from digits as d1 cross join digits as d2
)
,Sumd(d) as (
select d1.i+(10*d2.i) as Sumd
from digits as d1 cross join digits as d2
)
--select *
--from digits;
select *
from Sumd; |