title: MySQL Order By alternate values
body: <p>Im having trouble in MySQL query Order By.</p>
  
  <p>First I have a table(tbl_records) that contains 10000+ records. This table has a primary key called <strong>rec_id</strong> and a foreign key <strong>rec_f_id</strong>.</p>
  
  <p><strong>rec_f_id</strong> has only two kinds of value (555, 666).</p>
  
  <p>Now my problem is how can I gather the records on the table that orders in alternate value of <strong>rec_f_id</strong>.</p>
  
  <p>Eg</p>
  
  <p>Below is a dummy tbl records</p>
  
  <pre><code> | rec_id   |   rec_f_id |
   |2         |666         |
   |3         |555         |
   |7         |555         |
   |8         |666         |
   |9         |555         |
   |12        |666         |
   |25        |555         |
   |31        |555         |
   |84        |666         |
   |89        |555         |
   |91        |555         |
   |92        |666         |
   |113       |666         |
   |118       |666         |
   |125       |555         |
   |132       |555         |
   |170       |555         |
   |184       |666         |
  
  
   SELECT * FROM tbl_records ORDER BY FIELD(rec_f_id, 555, 666) LIMIT 100;
  </code></pre>
  
  <p>The above query only returns record with rec_f_id = 555.
  What I want to have is </p>
  
  <pre><code> | rec_id   |   rec_f_id |
   |31        |555         |
   |12        |666         |
   |3         |555         |
   |8         |666         |
   |25        |555         |
   |2         |666         |
   |7         |555         |
   |84        |666         |
   |9         |555         |
  
   ...
  </code></pre>
  
  <p>Thanks!</p>