Hi @Rainbow1517 ,
Welcome to Microsoft Q&A!
Please refer below:
create table Score
(ID int,
StartValue decimal(12,6),
EndValue decimal(12,6),
Score decimal(5,1))
;with cte as (
select row_number() over (order by (select null)) as n
from master..spt_values
)
insert into Score
select n,0.000001+5*(n-1),5.000000*n,0.5*n from cte where n<=100
union all
select n,0.000001-5*(n-100),-5.000000*(n-101),-0.5*(n-101) from cte
where n>100 and n<=201
select * from Score
Best regards
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.