SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
; with nums as ( select 1 as id, convert(int,RAND(CHECKSUM(NEWID()))*10) as rnd union all select id + 1 , convert(int,RAND(CHECKSUM(NEWID()))*100000) from nums where id < 100 union all select id * 100 + 1 , convert(int,RAND(CHECKSUM(NEWID()))*10000) from nums where id <= 100 ) select top 10000 dateadd(day, o.rnd%1000, '20210101') as credit_date, (o2.rnd%10 + o2.rnd%100)*100 as credit_sum into data from nums o cross join nums o2 where dateadd(day, o.rnd%1000, '20210101') < GETDATE() ORDER BY NEWID()

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear