mysql group by last record and find remark at last record too
<p>sorry miss some column my table is and data:</p>

<h2>tablename = tbreport</h2>

<h2>comcode,    user_id, comname, remark, date</h2>

<p>0010066,    32,     Wicam,  NotInterest, 2014-02-01
0010066,    32,     Wicam,  Discusing,   2014-02-05
0010066,    32,     Wicam,  Interest,    2014-02-08 
0010066,    32,     Wicam,  Pending ,    2014-02-21 
0010596,    32,     United, Interest,    2014-02-08 
0010606,    32,   SEACAM,  NotInterest  ,2014-03-08
0040025,   16,   SkyView,  Interest ,   2014-03-17</p>

<p>I use query below:</p>

<p>$uer_id='$_GET[user_id]';
$remark='$_GET[remark]';
$query = $link->query("SELECT * FROM (SELECT *FROM tbreport where user_id='$uid' ORDER by date DESC ) tbreport GROUP BY comcode");</p>

<p>the result show the last record :</p>

<hr>

<h2>comcode,    user_id, comname, remark,       date</h2>

<p>0010066,    32,      Wicam,  Pending ,    2014-02-21 
0010596,    32,      United, Interest,    2014-02-08<br>
0010606,    32,      SEACAM, NotInterest    ,2014-03-08
0040025,    32,      SkyView, Interest  ,2014-03-17</p>

<p>what I need the result like this</p>

<h2>when $remark = 'Interest' should show like below</h2>

<h2>comcode,    user_id, comname, remark,       date</h2>

<p>0010596,    32,      United,  Interest,    2014-02-08<br>
0040025,    32,      SkyView, Interest  ,2014-03-17</p>

<p>And when $remark= 'Pending' should show like below</p>

<hr>

<h2>comcode,    user_id, comname, remark,       date</h2>

<p>0010066,    32,      Wicam,  Pending ,    2014-02-21 </p>

<p>so how would I do more?
Thanks, if have any query 
Sary</p>