title: How to get max value from group by and groupconcat other field in mysql?
body: <p>I tried to get the max value corresponding row and group_concat all the email address.</p>
  <p>MySql table:</p>
  <pre><code>id  firstName LastName  email         value
  1   John      Seam      sa@gmail.com   450
  2   John      Seam      js@yahoo.com    0  
  3   Richard   Min       aa@gmail.com    0 
  </code></pre>
  <p>expected output:</p>
  <pre><code>id  firstName LastName   email                          value
  1   John      Seam      sa@gmail.com|js@yahoo.com       450
  3   Richard   Min       aa@gmail.com                     0 
  </code></pre>
  <p>I tried the following query:</p>
  <pre><code>select id,firstName,LastName,group_concat(email) ,max(value) 
  from table 
  group by firstName,LastName
  </code></pre>
  <p>but it gave wrong result:</p>
  <pre><code>id  firstName LastName   email                          value
  2   John      Seam      sa@gmail.com|js@yahoo.com       450
  3   Richard   Min       aa@gmail.com                     0 
  </code></pre>
  <p>instead of id 1 I am getting id 2. If I remove the group_concat it gives the correct output.</p>