SQL get rows based on two ids
<p>I really don't know how to title this problem properly.</p>

<p>Heres the table structure:</p>

<pre><code>ID | CLIENT_ID | …
</code></pre>

<p><code>ID</code> is primary and auto increment. <code>CLIENT_ID</code> on the other hand can occur multiple times.</p>

<p>What i want is to fetch the rows by <code>CLIENT_ID</code> with highest <code>ID</code> ... Heres a example</p>

<pre><code>ID | CLIENT_ID
1  | 1
2  | 1
3  | 2
4  | 3
5  | 2
</code></pre>

<p>So here <code>CLIENT_ID</code> 1 and 2 occurs multiple times (because there is a newer version).</p>

<p>After the query i want the following <code>ID</code>s in the results: 2,4,5 (Because the highest <code>ID</code> in rows with <code>CLIENT_ID</code> 1 is the row with <code>ID</code> 2 and so on)</p>