Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

basic MySQL question

unipusunipus New
edited August 2006 in Vanilla 1.0 Help
It's been a good year or two since I've done anything at all in MySQL and I don't remember a lot. So here's my question: is there an easy way, record by record, to take the value of one column and assign it to another? I've got a few thousand records that have valid DateCreated data but nothing but zeroes under DateLastActive. I'd like to just assign DateLastActive to take on whatever the value is of DateCreated, on a row-by-row basis.


  • Options
    This may work (not tested)

    UPDATE LUM_User SET DateLastActive = DateCreated WHERE DateLastActive = 0;
  • Options
    I should have clarified... I figured that would be the way to do it, but I want to make sure that the rows will maintain their individual integrity.
  • Options
    Confirmed now, though, and it works. Just had a momentary flash of stupidity where I felt like everything would fall apart. Of course that's the way it works. Sorry!
This discussion has been closed.