Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
declare @t table (Number int)
insert into @t values ( 80505),(7845203)
;with cte as (select T.number, SUBSTRING(ltrim(T.number),N.number,1) as [Digit]
from @t T
inner join dbo.numbers N on N.Number between 1 and LEN(T.number))
select c.Number as OriginalNumber, (select '' + LTRIM(digit)
from cte c1 where c1.Number = c.Number order by Digit
for XML path('')) as NewNumber
from cte c
group by c.Number
order by c.Number