# Hilfe! Problem mit der Aggregation?

**URL:** <https://community.gladysassistant.com/t/help-probleme-avec-lagregation/6630>\
**Category:** Configuration\
**Created:** [25. Oktober 2021 um 17:54 UTC](https://community.gladysassistant.com/t/help-probleme-avec-lagregation/6630 "2021-10-25T17:54:08Z")\
**Posts on this page:** 1\
**Showing post:** 56

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [3. Dezember 2021 um 13:37 UTC](https://community.gladysassistant.com/t/help-probleme-avec-lagregation/6630/56 "2021-12-03T13:37:51Z")

</div>

@lmilcent Hier, ein Geschenk:

```sql
SELECT COUNT(t_device_feature_state.id), device_feature_id,
t_device_feature.name as feature_name, t_device.name as device_name
FROM t_device_feature_state
JOIN t_device_feature ON t_device_feature.id = device_feature_id
JOIN t_device ON t_device.id = t_device_feature.device_id
GROUP BY device_feature_id
ORDER BY COUNT(t_device_feature_state.id) DESC;

```

---

_[View the full topic](https://community.gladysassistant.com/t/help-probleme-avec-lagregation/6630)._
