|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello, I am just wondering if I would be able to generate random numbers in sql or do i have to generate it using API and input data in the column.
I appreciate any help. Thanks in advanced. |
|
#2
|
||||
|
||||
|
You can do it in most databases but its not an ANSI SQL function. This means that the command to do it varies between databases. What database are you using?
MySQL has the rand() function, details here http://www.mysql.com/doc/en/Mathematical_functions.html PostgreSQL has the random() function, details here http://www.postgresql.org/docs/view...tions-math.html |
|
#3
|
|||
|
|||
|
I am so sorry I wasn't so clear in my first post. What I really needed to do was to generate random numbers in MS SQL 2000. Actually, I found youe have given me some links and I found an interesting idea to create functions in PostgreSQL. I wonder if I could do the same in MS SQL 2000.
I appreciate any help and thanks in advanced. |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > generating random numbers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|