title: Splitting name column with multiple delimiters
body: <p>I'm trying to split a name column (<code>fullname</code>) with the format <code>lastname, firstname</code> into two separate columns in MySQL using:</p>
  
  <pre><code>SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(fullname, ',', 1), ' ', -1) as firstname, SUBSTRING_INDEX(SUBSTRING_INDEX(fullname, ',', 2), ' ', -1) as lastname FROM tablename;
  </code></pre>
  
  <p>This works on <em>most</em> names. However, a name like "Del Torres Jr, Marcelo" shows up as </p>
  
  <pre><code>--------------------
  lastname | firstname
  --------------------   
  JR       | Marcelo  
  --------------------
  </code></pre>
  
  <p>How to I need to alter my statement to capture all of a name after the comma? </p>