by Jerry Lau.
hmm... would this work?
Data:
----
select id, username, idnumber from mdl_user where idnumber = "" order by id desc limit 10;
+-------+-----------+----------+
| id | username | idnumber |
+-------+-----------+----------+
| 83336 | 00010000 | |
| 83255 | 00010001 | |
| 83254 | 00010002 | |
| 83253 | 00010003 | |
| 83252 | 00010004 | |
| 83251 | 00010005 | |
| 83250 | 00010006 | |
| 83249 | 00010007 | |
| 83248 | 00010008 | |
| 83247 | 00010009 | |
+-------+-----------+----------+
10 rows in set (0.00 sec)
-------------------
update mdl_user
set idnumber = username
Is that it?