title: How can I select rows in reverse order in MySQL?
body: <p>How can I select rows in reverse order in MySQL?</p>
  <p>For example, I have a table with 12 rows (fields: id,location), I want to select the 4th row before a row with id = 6. I.e., the wanted row will have id = 'not necessarily 2', but there is a condition - where table.location='some_location'.</p>
  <p>What should the content of request to MySQL be like?</p>
  <hr/>
  <p>Here is a solution!</p>
  <p>Some example (I checked <a href="https://stackoverflow.com/questions/9582393/how-can-i-select-rows-in-reverse-order-in-mysql/9582677#9582677">drodil's suggestion</a>):</p>
  <pre class="lang-sql prettyprint-override"><code>mysql&gt; select * from subscrs where id &lt; 100000 order by id desc limit 4;
  +-------+--------+-----------+-------+
  | uid   | subscr | event     | id    |
  +-------+--------+-----------+-------+
  |  5307 |   5123 | feed_news | 99999 |
  | 25985 |   5211 | feed_news | 99998 |
  | 15123 |    130 | feed_news | 99997 |
  | 28368 |  19497 | feed_news | 99996 |
  +-------+--------+-----------+-------+
  4 rows in set (0.00 sec)
  </code></pre>