title: MySQL - PERL - Order by multiple columns, then ordered by columns part number field
body: <pre><code>id|pnumber|special|limitedtime|normal
  1 |765234 |1      |0          |0
  2 |765235 |0      |1          |0
  3 |776234 |0      |0          |1
  4 |776235 |1      |0          |0
  5 |785456 |0      |1          |0
  6 |785457 |1      |0          |0
  </code></pre>
  
  <p>Here is another scenario of a problem I had posted previously.</p>
  
  <p>Please note I am in fact using dbi and placeholders but, using just the basics for my question.</p>
  
  <p>Instead of three queries:</p>
  
  <pre><code>SELECT `pnumber` from `table`
  WHERE `special` &gt; 1
  ORDER BY ABS(pnumber) DESC 
  LIMIT $Lvar1,$Lvar2
  </code></pre>
  
  <p>execute and display</p>
  
  <pre><code>SELECT `pnumber` from `table`
  WHERE `limitedtime` &gt; 1
  ORDER BY ABS(pnumber) DESC 
  LIMIT $Lvar1,$Lvar2
  </code></pre>
  
  <p>execute and display</p>
  
  <pre><code>SELECT `pnumber` from `table`
  WHERE `normal` &gt; 1
  ORDER BY ABS(pnumber) DESC 
  LIMIT $Lvar1,$Lvar2
  </code></pre>
  
  <p>execute and display</p>
  
  <p>Which gives my results but, the LIMIT needs to be tied to all three /dependent.</p>
  
  <p>So, I want to do something like: </p>
  
  <pre><code>SELECT `pnumber` from `table`
  ORDER BY special?? ABS(pnumber) DESC,
  ORDER BY limitedtime?? ABS(pnumber) DESC,
  ORDER BY normal?? ABS(pnumber) DESC
  LIMIT $Lvar1,$Lvar2
  </code></pre>
  
  <p>Which, I think if done correctly, will give me my results in the order I desire.</p>
  
  <pre><code>765234 (special)
  776235 (special)
  785457 (special)
  765235 (limitedtime)
  785456 (limitedtime)
  776234 (normal)
  </code></pre>
  
  <p>I use the LIMIT $Lvar1,$Lvar2 for pagination / navigation.</p>
  
  <p>(The table has much more data results are actually being pushed into arrays because there is some cross referencing / querying to other tables going on later down the code.)</p>
  
  <p>Sure is a big question in which someone may answer with a simple here ya' go!</p>
  
  <p>Thanks for helping this noob everyone.</p>