title: Delete the Old record before/after insert the record in a table, iff the record count is > 2
body: <p>Delete the Old record in a Table before/after insert the record into that table, and delete the old record only when the record count is greater than Two.</p>
  
  <p>How to achieve the following Scenario:</p>
  
  <p>Table Name : <strong>Sample</strong></p>
  
  <pre><code>Id  Name    Date    Position
  1   phani   2013    Trainee
  2   phani   2014    Developer
  </code></pre>
  
  <p>Now we are Inserting One more record for phani</p>
  
  <p>i.e 3 phani 2015 sr.Developer</p>
  
  <p><strong>Result</strong>:</p>
  
  <pre><code>Id  Name    Date    Position
  1   phani   2013    Trainee
  2   phani   2014    Developer
  3   phani   2015    sr.Developer
  </code></pre>
  
  <p>Now we have to create one trigger, that trigger has to delete the old record<br>
  (means 2013 year record has to be delete.)</p>
  
  <p>Expected OutPut :</p>
  
  <pre><code>Id  Name    Date    Position
  2   phani   2014    Developer
  3   phani   2015    sr.Developer
  </code></pre>
  
  <p>Now let's say in 2016 again the position changed from sr.developer to Project Manager.</p>
  
  <p>That time 2014 year record has to be delete and insert new record,like Below :</p>
  
  <pre><code>Id  Name    Date    Position
  3   phani   2015    sr.Developer
  4   phani   2016    Project Manager
  </code></pre>