title: MySql Query: Select top 3 rows from table for each category
body: <p>I have a table with records and it has a row called <code>category</code>. I have inserted too many articles and I want to select only two articles from each category. </p>
  
  <p>I tried to do something like this: </p>
  
  <p>I created a view: </p>
  
  <pre><code>CREATE VIEW limitrows AS 
     SELECT * FROM tbl_artikujt ORDER BY articleid DESC LIMIT 2 
  </code></pre>
  
  <p>Then I created this query:</p>
  
  <pre><code>SELECT * 
  FROM tbl_artikujt 
  WHERE 
     artikullid IN
     (
        SELECT artikullid
        FROM limitrows
        ORDER BY category DESC
     )
  ORDER BY category DESC;
  </code></pre>
  
  <p>But this is not working and is giving me only two records?</p>