title: How to delete record from table if its count > 5
body: <p>I have following table:</p>
  
  <pre><code>id  systemid    value
  1      1           0
  2      1           1
  3      1           3
  4      1           4
  6      1           9
  8      1           10
  9      1           11
  10     1           12
  </code></pre>
  
  <p>Now here i have 8 records of <code>systemid = 1</code> so now i want to keep only latest 3 records (desc order) and delete older records whose <code>systemid=1</code></p>
  
  <p>I want output like :</p>
  
  <pre><code>id    systemid    value
   8     1            10
   9     1            11
   10    1            12
  </code></pre>
  
  <p>I just want to delete old records of systemid=1 only if its count > 5 and keep its latest 3 records.</p>
  
  <p>How can i do this in query ? </p>