dimanche 25 juin 2017

How to update and set random values in MySQL? [duplicate]

Is there a query to attribute random values to a column?

Take this table users for instance:

id | name |

With current values:

1 | user3456
2 | user0934
3 | user4356
...

Is there a way I can randomly attribute DIFFERENT names to all rows that start with user?

UPDATE users
SET name = papadoe, mamadoe, babydoe
WHERE name like "user%"; 




Aucun commentaire:

Enregistrer un commentaire