# Basic SELECT clauses not working with GROUP BY

**URL:** <https://community.influxdata.com/t/basic-select-clauses-not-working-with-group-by/56981>\
**Category:** Systems\
**Tags:** sql\
**Created:** [April 10, 2025, 5:58pm UTC](https://community.influxdata.com/t/basic-select-clauses-not-working-with-group-by/56981 "2025-04-10T17:58:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aep-sunlife](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/aep-sunlife/32/19767_2.png) [@aep-sunlife](https://community.influxdata.com/u/aep-sunlife)\
**Post date:** [April 10, 2025, 5:58pm UTC](https://community.influxdata.com/t/basic-select-clauses-not-working-with-group-by/56981/1 "2025-04-10T17:58:24Z")

</div>

InfluxDB keeps rejecting GROUP BY queries with various SELECT clauses.

```sql
SELECT "path","used_percent"
FROM "disk"
GROUP BY "path";

```

```console
Error while planning query: Error during planning: Projection references non-aggregate values: Expression disk.used_percent could not be resolved from available columns: disk.path: rpc error: code = InvalidArgument desc = Error while planning query: Error during planning: Projection references non-aggregate values: Expression disk.used_percent could not be resolved from available columns: disk.path

```

```sql
SELECT *
FROM "disk"
GROUP BY "path";

```

```console
flightsql: rpc error: code = InvalidArgument desc = Error while planning query: Error during planning: Projection references non-aggregate values: Expression disk.used_percent could not be resolved from available columns: disk.path
(Trace ID: fd4375358a696715de10bbe3b41ee7df)

```

Please ensure that GROUP BY works with SELECT clause table columns other than an exact set match of those chosen for the GROUP BY deduplication clause.

---

<div class="post-metadata">

**Author:** ![aep-sunlife](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/aep-sunlife/32/19767_2.png) [@aep-sunlife](https://community.influxdata.com/u/aep-sunlife)\
**Post date:** [April 10, 2025, 6:38pm UTC](https://community.influxdata.com/t/basic-select-clauses-not-working-with-group-by/56981/2 "2025-04-10T18:38:03Z")

</div>

MAX() works but not the plain value

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [April 15, 2025, 7:13pm UTC](https://community.influxdata.com/t/basic-select-clauses-not-working-with-group-by/56981/3 "2025-04-15T19:13:25Z")

</div>

Hello @aep-sunlife,  
The docs specify:

> `GROUP BY` is an optional clause used to group rows that have the same values for all columns and expressions in the list. To output an aggregation for each group, include an aggregate or selector function in the `SELECT` statement.

Can you please try that?  
[GROUP BY clause | InfluxDB Cloud Serverless Documentation](https://docs.influxdata.com/influxdb3/cloud-serverless/reference/sql/group-by/#:~:text=GROUP%20BY%20is%20an%20optional,function%20in%20the%20SELECT%20statement).

Oh I just saw your second comment. Yah you have to include a selector or aggregate function.
