CartMetrix - Do you know yours?

« iTunes and Links to Music Store | Home | Hegemony »

6/20/2006

MySQL RAND Function To Randomly Populate Table

MySQL’s RAND() function can be used to set random values or fill a table with random data.

The following SQL snippet will change column1 in all rows to a random number 0-50.

UPDATE tablename SET column1 = (rand() * 50)

Popularity: 24%

Trackback:

Related Posts

Post your opinion

Verification Image

Please type the letters you see in the picture.

Subscribe without commenting


damonparker.org is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

copyright © 2002-2009 damonparker.org. all rights reserved.

Close
E-mail It