title: Concat multiple columns then splitting them - MySQL
body: <p>This is a really a two step process I need. I have a table that has 26 columns that look like this:</p>
  
  <pre><code>ColumnA   ColumnB   ColumnC  ColumnD  ColumnE  ColumnF
  
  winter       0        0      summer   0        Dog
  
  0          spring    fall      0      0        0
  
  0            0        0      summer   car      0
  </code></pre>
  
  <p>I need to be able to Concat all the words in the columns into one column separated by a | but leaving out any zeros in other columns. The first row should look like this in column 27 <strong>winter|summer|dog</strong>. I then need to be able to separate the results in column 27 <strong>winter|summer|dog</strong> into column 28 winter, column 29 summer, column 20 dog</p>
  
  <p>The results would look like this:</p>
  
  <pre><code>Column28    Column29    Column30
  
  winter      summer      dog
  
  spring      fall
  
  summer      car
  </code></pre>
  
  <p>The program I am using doesn't allow me to use wildcards, so I need to take the 26 columns and dump them into 3 as the most a row has in any of the 26 columns is three words. I have 750,000 rows and the searches are taking forever. </p>
  
  <p>There could be an easier way of just moving the first instance of not a 0 in any column into column 28, the second instance of not a zero in a row to column 29, etc. I also have a bunch of other columns before the 26 columns I posted above like name, phone, etc. that you should be aware of as you cant just say first none zero in a row to column 27.</p>