Got a big table and I want to add a column that has a randomly chosen number for each record. 1, 2, or 3.
Examples:
UPDATE tableName SET columnName = FLOOR( 1 + RAND( ) *3 );
UPDATE 'videos' SET 'views' = rand(1,10000);
Update videos set views = CAST(RAND() * 10000 AS UNSIGNED);
Examples:
UPDATE tableName SET columnName = FLOOR( 1 + RAND( ) *3 );
UPDATE 'videos' SET 'views' = rand(1,10000);
Update videos set views = CAST(RAND() * 10000 AS UNSIGNED);
0 comments:
Post a Comment