title: MySQL: Select 3 most occuring strings either in column 1 or column 2
body: <p>I'd like to have the 3 most occuring strings from 2 rows of my database. The thing is the string may occur in column1 or column2. I'd like to use only one query. Thanks in advance</p>
  
  <p>Sample DB:  </p>
  
  <pre><code>id string1 string2  
  1  foo     bar  
  2  bar     foo  
  3  api     foo  
  </code></pre>
  
  <p>Output should then be:  </p>
  
  <pre><code>string count  
  foo    3  
  bar    2  
  api    1
  </code></pre>