title: How to get latest result of two different row id laravel
body: <p>Hi i am trying to get the lates result of assessment 1 and latest result of assessment 2 order  by date.
  eg.</p>
  
  <pre><code>     |id| name | assessment| date      |Course_code
       | 1|jon   |1          |2014-01-01 |1
       | 2|jon   |1          |2014-01-05 |1
       | 3|jon   |1          |2014-01-01 |2
       | 4|jon   |2          |2014-01-01 |1
       | 5|jon   |2          |2014-01-11 |2
       | 6|jon   |2          |2014-01-14 |1
       | 7|jon   |2          |2014-01-01 |1
       | 8|jon   |1          |2014-01-11 |1
  </code></pre>
  
  <p>here i want to get the latest assessment 2 and latest assessment 1 in single query building.
  I am using laravel 4 here what i am doing.</p>
  
  <pre><code>DB::table('result')-&gt;where('username','jon')-&gt;where('course_code','1')-&gt;where('assignment_no',1)-&gt;orderBy('date','Desc')-&gt;limit(1)-&gt;get();
  </code></pre>
  
  <p>i hd done for assessment 1  and assessment 2 separately can i get the result for both on one single query building?</p>