clear markdown feedback
clear markdown feedback
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 3364508 fiddles created (36226 in the last week).

USE master DECLARE @i INT =5; WITH C as(SELECT number z,abs(@i+~number)f FROM spt_values WHERE'P'=type)SELECT top(@i*2-1)space(f*2)+v+stuff(reverse(v),1,3,'')FROM(SELECT*,(SELECT top(@i-f)char(65+z)+' 'FROM c for xml path(''),type).value('.','varchar(52)')v FROM c)d
(No column name)
A
A B A
A B C B A
A B C D C B A
A B C D E D C B A
A B C D C B A
A B C B A
A B A
A
Changed database context to 'master'.
 hidden batch(es)