# MySQL Query Help

**URL:** <https://forum.inductiveautomation.com/t/mysql-query-help/14508>\
**Category:** Ignition\
**Created:** [June 13, 2017, 8:00pm UTC](https://forum.inductiveautomation.com/t/mysql-query-help/14508 "2017-06-13T20:00:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Micky.Franks](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@Micky.Franks](https://forum.inductiveautomation.com/u/Micky.Franks)\
**Post date:** [June 13, 2017, 8:00pm UTC](https://forum.inductiveautomation.com/t/mysql-query-help/14508/1 "2017-06-13T20:00:01Z")

</div>

How do i select the latest id on the one that are multiples from a query? The ones that have the same values for binNo I just want the latest.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/7d466c3aa545cd5bb6b819fe098d5fbe21cf75a2.png)

---

<div class="post-metadata">

**Author:** ![Duffanator](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/duffanator/32/3560_2.png) [@Duffanator](https://forum.inductiveautomation.com/u/Duffanator)\
**Post date:** [June 13, 2017, 8:10pm UTC](https://forum.inductiveautomation.com/t/mysql-query-help/14508/2 "2017-06-13T20:10:38Z")

</div>

```auto
Select id, binNo, cwts
From roughstoragesum t1
where id = (select max(id) from roughstoragesum where t1.binNo =roughstoragesum.binNo)
order by id desc

```
