This is not a MODx questions, and I have asked the question in MySQL forums, but have not yet received a response. Here I have always got answers, so I take the chance to ask the question here too:
Is it possible in MySQL and retrieve data from a row and put it into another row? I have a field called Name in a MODx table, with data in the form
Firstname Lastname. I need to put this into another row as
Last Name, First Name, and as
Firstname in a separate field and
Lastname in another field. Is this possible via SQL?
That way I avoid having to change the 2000 fields manually.
Thanks.
I think, thererfor I am! But what I am, and why...?
you can try:
update mytable set firstname = substr(fullname,1,LOCATE(' ',fullname)-1),lastname = substr(fullname,LOCATE(' ',fullname)+1)
Thanks

. It works!
I think, thererfor I am! But what I am, and why...?