title: Explode and implode strings in mysql query
body: <pre><code>+------+-----------------+
  |  id  |      name       +
  +------+-----------------+
  |  1   | David Gilmour   |
  |  2   | Roger Waters    |
  |  3   | Li Jen Ho       |
  +------+-----------------+
  </code></pre>
  
  <p>Current format of names is <code>firstName lastName</code> and I want to change it to <code>lastName firstName</code> and I want to that in one database query.</p>
  
  <p>The solution I've in my mind is to split names by <code>space</code>, reversing items and then imploding them again with <code>space</code> glue. But I don't know how to write a query for that.</p>
  
  <p><br/><br/>
  <em>I can simply do that in PHP by exploding names by space and putting them inside an array, reversing the array and then imploding the words by space glue but currently I don't have access to PHP.</em></p>
  
  <p><strong>Update 1:</strong> I found <a href="https://stackoverflow.com/questions/14950466/how-to-split-the-name-string-in-mysql">this similar question</a> but I can't make it work. I hope I'm not asking a duplicate question.</p>
  
  <p><strong>Update 2:</strong> Names can have more than 2 parts. I assume only the first word is first name and the rest of name is last name.</p>