title: Retrieve latest timestamp for each Id in list - MySQL
body: <p>I'm running a command to retrieve all rows for today with IDs matching 1, 2, 3, etc.</p>
  <p>I want to retrieve the latest entry for these IDs for today though.</p>
  <p>So rather than getting:</p>
  <p>BinID | Timestamp |</p>
  <p>2  |  29/04/2021 3:49pm</p>
  <p>2  |  29/04/2021 4:41pm</p>
  <p>3  |  29/04/2021 2:24pm</p>
  <p>I want:</p>
  <p>BinID | Timestamp |</p>
  <p>2  |  29/04/2021 4:41pm</p>
  <p>3  |  29/04/2021 2:24pm</p>
  <p>Is this possible?</p>
  <p>This is the command I'm running at the moment.</p>
  <pre><code>MySqlCommand mysqlcom = new MySqlCommand(&quot;SELECT * FROM realtime_gpses WHERE BinId IN (&quot; + binIdsCSVString + &quot;) AND Timestamp &gt;= CURDATE() AND Timestamp &lt; CURDATE() + INTERVAL 1 DAY&quot;, mysqlcon);
  </code></pre>
  <p>where <code>binIdsCSVString</code> in this cases is just 2, 3.</p>