title: How to limit the results of a SQL query by group
body: <p>I have this query:</p>
  
  <pre><code>select article_number, date, company, size, price 
  from price 
  order by article_number, company, date
  </code></pre>
  
  <p>that produces these results:</p>
  
  <pre><code>('50240-20', '2016-03-08 13:06:12.872955', '2B', '20', '645,75')
  ('50240-20', '2016-03-08 13:13:55.311955', '2B', '20', '645,75')
  ('50240-20', '2016-03-08 13:47:13.737155', '2B', '20', '645,75')
  ('50240-20', '2016-03-08 13:51:32.677155', '2B', '20', '645,75')
  ('50240-20', '2016-03-08 13:06:12.872955', 'Bio', '20', '423,20')
  ('50240-20', '2016-03-08 13:13:55.311955', 'Bio', '20', '423,20')
  ('50240-20', '2016-03-08 13:47:13.737155', 'Bio', '20', '423,20')
  ('50240-20', '2016-03-08 13:51:32.677155', 'Bio', '20', '423,20') ...
  </code></pre>
  
  <p>I want to limit the results for each <code>article_number</code> and <code>company</code> selection so that it only show 2 results with 2 last different dates. So the result should look like:</p>
  
  <pre><code>('50240-20', '2016-03-08 13:47:13.737155', '2B', '20', '645,75')
  ('50240-20', '2016-03-08 13:51:32.677155', '2B', '20', '645,75')
  
  ('50240-20', '2016-03-08 13:47:13.737155', 'Bio', '20', '423,20')
  ('50240-20', '2016-03-08 13:51:32.677155', 'Bio', '20', '423,20') ...
  </code></pre>
  
  <p>Can anyone help me how to do this? A simple limit 2 at the end will only give out 2 results at all and not for each "group"</p>
  
  <p>THX!</p>