Quantcast
Channel: Authentication
Viewing all articles
Browse latest Browse all 8256

Re: SQL statement assistance - how to update field with same value from another field in same table

$
0
0
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?


Viewing all articles
Browse latest Browse all 8256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>