 <p>Use a case expression to get an order key:</p> <pre><code>select * from book_history order by case status when 1 then 100 -- any small value would do here when 0 then 200 -- any medium value would do here when 2 then 300 -- any big value would do here end; </code></pre>