79471769

Date: 2025-02-27 06:33:39
Score: 1
Natty:
Report link

You can make use of a tally table and with substring()

declare @str  varchar(100) = 'AaaaaBbbbbCccccDdddd';
declare @m    int = 5,
        @n    int = 4

select t.i, op = substring(@str, (t.i * @m) + 1, @m)
from   tally t
where  t.i >= 0 
  and  t.i <  @n
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: hkt