title: Is there a way to rank values in MySql according to what column they belong to?
body: <p>Okay, so lets say that we have 4 columns and 3 rows of data.</p>
  
  <pre><code>|user_id|pick_1|pick_2|pick_3|
  -------------------------------
  |fred   |C++   |java  | php  |
  ------------------------------
  |eric   |java  |C++   | php   |
  ------------------------------
  |sam    | C++  | php  | java |
  ------------------------------
  </code></pre>
  
  <p>So right now, users are entering their favorite languages. The first pick(pick_1) would be the favorite programming language and the second pick (pick_2) would be the 2nd favorite programming language  and etc.</p>
  
  <p>How can I organize this in a way so that I can give a point value according to what columns the programming languages are. So maybe pick_1 can give 3 points, pick_2 can give 2 points and pick_3 can give 1 point. </p>
  
  <p>So when you tally up the scores, C++ will have 8 points, java will have 6 points, and php will have 4 points.</p>
  
  <p>That way I can give an overall ranking of what tends to be the more favorable programming language. Like so</p>
  
  <pre><code>  |rank|language|points|
    ----------------------
    |  1 |  C++   | 8    |
    ----------------------
    |  2 |  java  | 6    |
    ----------------------
    |  3 |  php   | 4    |
    ----------------------
  </code></pre>
  
  <p>It doesn't even need to have a point system, I just couldn't think of another way to rank the languages on a scale of liked to un-liked. So if there's another way to yield the same results than please let me know. Otherwise how would I be able to do this. Preferably in just MySql. I am currently using PHP.</p>
  
  <p>Thank you for reading.</p>