0

I've got a table that contains a column called name, some of the values in name table are empty and I'd like to populate them randomly from name within the same table/column

update table
set name= (SELECT name
FROM table where name!= '' order by rand() limit 1)
where name!= '';

I tried this but didn't work! I'm not sure why

Query execution failed


Reason:
SQL Error [1093] [HY000]: You can't specify target table 'table' for update in FROM clause
Jaockz
  • 1

0 Answers0