SQL 亂數取得固定位數

亂數取得固定位數

SQL 隨機亂數 5位數

select RIGHT(CONVERT(varchar,abs(cast(cast(newid() as binary(4)) as int)) + 30000000000),5)