# Show me all "last value" sorted by serial number question from influx newbie

**URL:** <https://community.influxdata.com/t/show-me-all-last-value-sorted-by-serial-number-question-from-influx-newbie/26443>\
**Category:** InfluxDB 1\
**Created:** [September 7, 2022, 1:30pm UTC](https://community.influxdata.com/t/show-me-all-last-value-sorted-by-serial-number-question-from-influx-newbie/26443 "2022-09-07T13:30:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![steavie](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/steavie/32/10928_2.png) [@steavie](https://community.influxdata.com/u/steavie)\
**Post date:** [September 7, 2022, 1:30pm UTC](https://community.influxdata.com/t/show-me-all-last-value-sorted-by-serial-number-question-from-influx-newbie/26443/1 "2022-09-07T13:30:38Z")

</div>

Hello community, I have several electricity meters which write their values into an influx DB. All in one messurement. Now I would like to have the last value for each counter. The meters can be distinguished by their serial number. In Mysql I get the query, somehow I can’t do it with the syntax in influx. Could anyone help me, please

 ![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/6/67a70bff6d48617dae5db1afa56b9abe9e354e06.png)

---

<div class="post-metadata">

**Author:** ![Giovanni\_Luisotto](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/giovanni_luisotto/32/4017_2.png) [@Giovanni\_Luisotto](https://community.influxdata.com/u/Giovanni_Luisotto)\
**Post date:** [September 7, 2022, 3:24pm UTC](https://community.influxdata.com/t/show-me-all-last-value-sorted-by-serial-number-question-from-influx-newbie/26443/2 "2022-09-07T15:24:45Z")

</div>

What did you try? what’s your data structure (tags/fields)?

I could generically say that a simple

```auto
SELECT last(*) FROM ___ WHERE time > now()-30m GROUP BY *

```

might do the trick
