Mysql Sql order before group by
<p>My Table As(users):</p>

<pre><code>id    sdate                  ip

1     2016-03-19 22:43:52    88.234.15.68
2     2016-03-19 22:43:58    88.234.15.68
</code></pre>

<p>I want to short then group by. But I could not be successful. i can use this sql statement; </p>

<pre><code>SELECT * 
FROM (SELECT * FROM users ORDER BY sdate DESC) as test 
GROUP BY test.ip 
ORDER BY sdate DESC
</code></pre>

<p>I get the following output:</p>

<pre><code>SELECT * 
FROM (SELECT * FROM users ORDER BY sdate DESC) as test 
GROUP BY test.ip 
ORDER BY sdate DESC

id    sdate                  ip

1     2016-03-19 22:43:52    88.234.15.68
</code></pre>

<p>i want to this output</p>

<pre><code>id    sdate                  ip

2     2016-03-19 22:43:58    88.234.15.68
</code></pre>