title: Retrieve only the first row per student
body: <p>Suppose I have a table which stores data for students and the respected grades per classes. In most cases, there exists multiple rows per student in the table.</p>
  <pre><code>student_id           math           chemistry        science
   100                  A                B                C              &lt;--------
   100                  B                A                D
   100                  D                F                C
   200                  B                A                C              &lt;--------
   300                  C                D                F              &lt;--------
   300                  A                A                A              
   400                  F                C                B              &lt;--------
   400                  B                A                C              
   500                  A                B                A              &lt;--------
  </code></pre>
  <p>I want to retrieve the <strong>first row</strong> as per the student_id as explained below.</p>
  <p>Requested in postgreSQL:</p>
  <pre><code>student_id           math           chemistry        science
   100                  A                B                C
   200                  B                A                C
   300                  C                D                F
   400                  F                C                B
   500                  A                B                A 
  </code></pre>