title: Combining many sort ranks into one master sort rank
body: <p>Say I have some sorted result from a SQL query that looks like:</p>
  
  <pre><code>x y z 
  0 0 0 
  0 0 1 
  0 0 2
  0 1 0
  0 1 1 
  0 2 0
  0 2 1 
  </code></pre>
  
  <p>Where <code>x</code>, <code>y</code> and <code>z</code> are sort ranks. These sort ranks are always greater than 0, and smaller than 500mil.</p>
  
  <hr>
  
  <p>Is there a way to combine the values from <code>x</code>, <code>y</code> and <code>z</code> into one "master" sort rank? Sorting the dataset using this "master" sort rank should result in the same ordering.</p>
  
  <p>I'm thinking I can do something with bit shifting but I am not sure...</p>