title: Select top three values in each group
body: <p>following is my sample table and rows </p>
  
  <pre><code>create table com (company text,val int);
  
  
  insert into com values ('com1',1),('com1',2),('com1',3),('com1',4),('com1',5);
  
  insert into com values ('com2',11),('com2',22),('com2',33),('com2',44),('com2',55);
  
  insert into com values ('com3',111),('com3',222),('com3',333),('com3',444),('com3',555);
  </code></pre>
  
  <p>I want to get the top 3 value of each company, expected output is :</p>
  
  <pre><code>company  val
  ---------------
  com1     5
  com1     4
  com1     3
  com2     55
  com2     44
  com2     33
  com3     555
  com3     444
  com3     333
  </code></pre>