title: Get data from records having multiple count and manipulate them
body: <p>I have a sample record like below in one of my SQL tables:</p>
  <p><a href="https://i.stack.imgur.com/RKrnr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RKrnr.png" alt="enter image description here" /></a></p>
  <p>What I want is my select query should take the student record which has multiple count of same subjects, ie, Student A has a count(6) for subject COD and use a case statement to give the first record as failed and rest of the record as After Fail.</p>
  <p>Ex output:</p>
  <p><a href="https://i.stack.imgur.com/48qhD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/48qhD.png" alt="enter image description here" /></a></p>
  <p>I'm not able to implement a correct logic to get this.</p>
  <p>Thanks in advance!</p>