Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#TSQL, 129 bytes

TSQL, 129 bytes

USE MASTER in the beginning of the script is to ensure that the query is run in the master database which is default for many users(not counting bytes for that).

Golfed:

USE MASTER
SELECT SUBSTRING(REPLICATE('ABCDEFGHIJKLMNOPQRSTUVWXYZ',26),number*number+1,number*2+1)FROM spt_values WHERE number<26and'P'=type

Ungolfed:

USE MASTER
SELECT SUBSTRING(REPLICATE('ABCDEFGHIJKLMNOPQRSTUVWXYZ',26),number*number+1,number*2+1)
FROM spt_values
WHERE number<26and'P'=type

Fiddle

Fiddle for older version using xml path

#TSQL, 129 bytes

USE MASTER in the beginning of the script is to ensure that the query is run in the master database which is default for many users(not counting bytes for that).

Golfed:

USE MASTER
SELECT SUBSTRING(REPLICATE('ABCDEFGHIJKLMNOPQRSTUVWXYZ',26),number*number+1,number*2+1)FROM spt_values WHERE number<26and'P'=type

Ungolfed:

USE MASTER
SELECT SUBSTRING(REPLICATE('ABCDEFGHIJKLMNOPQRSTUVWXYZ',26),number*number+1,number*2+1)
FROM spt_values
WHERE number<26and'P'=type

Fiddle

Fiddle for older version using xml path

TSQL, 129 bytes

USE MASTER in the beginning of the script is to ensure that the query is run in the master database which is default for many users(not counting bytes for that).

Golfed:

USE MASTER
SELECT SUBSTRING(REPLICATE('ABCDEFGHIJKLMNOPQRSTUVWXYZ',26),number*number+1,number*2+1)FROM spt_values WHERE number<26and'P'=type

Ungolfed:

USE MASTER
SELECT SUBSTRING(REPLICATE('ABCDEFGHIJKLMNOPQRSTUVWXYZ',26),number*number+1,number*2+1)
FROM spt_values
WHERE number<26and'P'=type

Fiddle

Fiddle for older version using xml path

deleted 208 characters in body
Source Link
t-clausen.dk
  • 3.8k
  • 13
  • 17

#TSQL, 177129 bytes

This has been done without looping. The

USE MASTER

USE MASTER in the beginning of the script is to ensure that the query is run in the master database which is default for many users(not counting bytes for that).

Golfed:

USE MASTER;MASTER
WITH n(n)as(SELECT number FROM spt_values WHERE'P'=type)SELECT(SELECT char(65+SUBSTRING(n+x.n*x.n)%26)FROM n WHERE n<=x.n*2FOR xml pathREPLICATE('')'ABCDEFGHIJKLMNOPQRSTUVWXYZ',type26).value('.','char(51)'number*number+1,number*2+1)FROM n xspt_values WHERE n<26number<26and'P'=type

Ungolfed:

USE MASTER;
WITH n(n)as
(
 SELECT number
 FROM spt_values
 WHERE'P'=type
)
SELECTMASTER
(
SELECT char(65+SUBSTRING(n+x.n*x.n)%26)
 FROM n
 WHERE n<=x.n*2
 FOR xml pathREPLICATE('')'ABCDEFGHIJKLMNOPQRSTUVWXYZ',type26).value('.','char(51)'number*number+1,number*2+1)
FROM n xspt_values
WHERE n<26number<26and'P'=type

Fiddle

Fiddle for older version using xml path

#TSQL, 177 bytes

This has been done without looping. The

USE MASTER

in the beginning of the script is to ensure that the query is run in the master database which is default for many users(not counting bytes for that).

Golfed:

USE MASTER;
WITH n(n)as(SELECT number FROM spt_values WHERE'P'=type)SELECT(SELECT char(65+(n+x.n*x.n)%26)FROM n WHERE n<=x.n*2FOR xml path(''),type).value('.','char(51)')FROM n x WHERE n<26

Ungolfed:

USE MASTER;
WITH n(n)as
(
 SELECT number
 FROM spt_values
 WHERE'P'=type
)
SELECT
(
SELECT char(65+(n+x.n*x.n)%26)
 FROM n
 WHERE n<=x.n*2
 FOR xml path(''),type).value('.','char(51)')
FROM n x
WHERE n<26

Fiddle

#TSQL, 129 bytes

USE MASTER in the beginning of the script is to ensure that the query is run in the master database which is default for many users(not counting bytes for that).

Golfed:

USE MASTER
SELECT SUBSTRING(REPLICATE('ABCDEFGHIJKLMNOPQRSTUVWXYZ',26),number*number+1,number*2+1)FROM spt_values WHERE number<26and'P'=type

Ungolfed:

USE MASTER
SELECT SUBSTRING(REPLICATE('ABCDEFGHIJKLMNOPQRSTUVWXYZ',26),number*number+1,number*2+1)
FROM spt_values
WHERE number<26and'P'=type

Fiddle

Fiddle for older version using xml path

Source Link
t-clausen.dk
  • 3.8k
  • 13
  • 17

#TSQL, 177 bytes

This has been done without looping. The

USE MASTER

in the beginning of the script is to ensure that the query is run in the master database which is default for many users(not counting bytes for that).

Golfed:

USE MASTER;
WITH n(n)as(SELECT number FROM spt_values WHERE'P'=type)SELECT(SELECT char(65+(n+x.n*x.n)%26)FROM n WHERE n<=x.n*2FOR xml path(''),type).value('.','char(51)')FROM n x WHERE n<26

Ungolfed:

USE MASTER;
WITH n(n)as
(
 SELECT number
 FROM spt_values
 WHERE'P'=type
)
SELECT
(
 SELECT char(65+(n+x.n*x.n)%26)
 FROM n
 WHERE n<=x.n*2
 FOR xml path(''),type).value('.','char(51)')
FROM n x
WHERE n<26

Fiddle

AltStyle によって変換されたページ (->オリジナル) /