 <p>Currently your query is returning 4 rows:</p> <pre><code>[ { name: 'john', baggageno: 5, destination: 'toronto', 'max(ts)': 'Sat Mar 14 2015 02:25:03 GMT-0400' }, { name: 'jill', baggageno: 1, destination: 'karachi', 'max(ts)': 'Sat Mar 14 2015 02:25:03 GMT-0400' }, { name: 'jane', baggageno: 2, destination: 'new york', 'max(ts)': 'Sat Mar 14 2015 02:25:03 GMT-0400' }, { name: 'jim', baggageno: 5, destination: 'glasgow', 'max(ts)': 'Sat Mar 14 2015 02:25:03 GMT-0400' }, ] </code></pre> <p>and you're picking the first row out of that result set, so that is why you're seeing what you're seeing (although the ordering of the rows is up to the server because you did not request a specific ordering).</p> <p>You need to add some kind of filter if you're trying to find the record(s) with the latest <code>ts</code> value. For example, using a join might look something like:</p> <pre class="lang-sql prettyprint-override"><code>SELECT map.* FROM map LEFT JOIN map map2 ON map.name = map2.name AND map.baggageno = map2.baggageno AND map.destination = map2.destination AND map.ts &lt; map2.ts WHERE map2.name IS NULL </code></pre> <p>You can also do something similar except using an inner join, if you want to do it that way.</p>