블로그 이미지
bedbmsguru

Notice

Recent Comment

Recent Trackback

Archive

calendar

    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
  • 27,334total
  • 0today
  • 8yesterday
2011.06.29 11:12 SQL SERVER


원문 출처
http://blog.sqlauthority.com/2007/04/29/sql-server-random-number-generator-script-sql-query/


가장 간단한 방법만 퍼왔다. 요긴하게 쓸 수 있을듯.ㅋㅋ
Method 3 : Random Numbers Quick Scripts
---- random float from 0 up to 20 - [0, 20)
SELECT 20*RAND()
-- random float from 10 up to 30 - [10, 30)
SELECT 10 + (30-10)*RAND()
--random integer BETWEEN 0
AND 20 - [0, 20]
SELECT CONVERT(INT, (20+1)*RAND())
----random integer BETWEEN 10
AND 30 - [10, 30]
SELECT 10 + CONVERT(INT, (30-10+1)*RAND()


저작자 표시
신고
posted by bedbmsguru

티스토리 툴바