How to generate numbers with a normal distribution in SQL Server

前端 未结 3 1146
深忆病人
深忆病人 2021-01-17 23:50

I\'m trying to seed some data, is there anyway to generate numbers in SQL Server that follow a normal distribution curve?

Like: I will specify the mean, the standard

3条回答
  •  花落未央
    2021-01-18 00:29

    random normal distribution

    UPDATE TABLE 
    SET COLUMN = CAST(SQRT(-2*LOG(RAND()))*SIN(2*PI()*RAND(CHECKSUM(NEWID())))as decimal(5,3))    
    from TABLE
    

提交回复
热议问题