title: to get max value in a row from pig
body: <p>to get max value from pig:</p>
  
  <p>student(rollno,marks)</p>
  
  <pre><code>rollno. marks
  
  1   24
  
  2   26
  
  3   50
  
  4   30
  
  5   35
  </code></pre>
  
  <p>output req: max marks roll no.</p>
  
  <p>output:
  3 50</p>
  
  <p>suppose A contains the values of student table</p>
  
  <p>how to get rollno. scored max marks</p>
  
  <p>I tried this:</p>
  
  <pre><code>B = GROUP A BY rollno
  
  C = foreach B generate group , max( A.marks);
  </code></pre>
  
  <p>but it is resulting all records can any one help me this in pig</p>