title: Selecting the first row from each group, with ORDER BY more than one column
body: <p>I have a table <code>T</code> with columns <code>x</code>,<code>y</code>,<code>a</code>,<code>b</code> such that </p>
  
  <pre><code>SELECT x,y,a,b FROM T
  ORDER BY x,y,a,b
  </code></pre>
  
  <p>gives me the following table</p>
  
  <pre><code> x    | y    | a    | b
   x1   | y1   | a1   | b1
   x1   | y1   | a1   | b2
   x1   | y1   | a2   | b1
   x1   | y2   | a1   | b1
   x1   | y2   | a1   | b2
   x1   | y2   | a2   | b1
  </code></pre>
  
  <p>How would I get the first row of each x,y group? That is, how would I get the following table</p>
  
  <pre><code> x    | y    | a    | b
   x1   | y1   | a1   | b1
   x1   | y2   | a1   | b1
  </code></pre>
  
  <hr>
  
  <p>Here is a second example: For a table T such that</p>
  
  <pre><code> x    | y    | a    | b
   x1   | y1   | a1   | b3
   x1   | y1   | a1   | b4
   x1   | y1   | a2   | b1
   x1   | y1   | a2   | b2
   x1   | y2   | a1   | b3
   x1   | y2   | a1   | b4
   x1   | y2   | a2   | b1
   x1   | y2   | a2   | b2
  </code></pre>
  
  <p>I am expecting to get</p>
  
  <pre><code> x    | y    | a    | b
   x1   | y1   | a1   | b3
   x1   | y2   | a1   | b3
  </code></pre>