---
title: Query data with InfluxQL
description: Learn to use InfluxQL to query data stored in InfluxDB Clustered.
url: https://docs.influxdata.com/influxdb3/clustered/query-data/influxql/
estimated_tokens: 3161
product: InfluxDB Clustered
version: clustered
---

# Query data with InfluxQL

Learn to use InfluxQL to query data stored in InfluxDB Clustered.

-   [Explore your schema with InfluxQL](#explore-your-schema-with-influxql)
-   [Perform a basic InfluxQL query](#perform-a-basic-influxql-query)
-   [Aggregate data with InfluxQL](#aggregate-data-with-influxql)
-   [Troubleshoot InfluxQL errors](#troubleshoot-influxql-errors)
-   [Use parameterized queries with InfluxQL](#use-parameterized-queries-with-influxql)

### [Explore your schema with InfluxQL](/influxdb3/clustered/query-data/influxql/explore-schema/)

Use InfluxQL `SHOW` statements to return information about your data schema.

##### List measurements

```sql
SHOW MEASUREMENTS
```

##### List field keys in a measurement

```sql
SHOW FIELD KEYS FROM "measurement"
```

##### List tag keys in a measurement

```sql
SHOW TAG KEYS FROM "measurement"
```

##### List tag values for a specific tag key

```sql
SHOW TAG VALUES FROM "measurement" WITH KEY = "tag-key" WHERE time > now() - 1d
```

[Read more](/influxdb3/clustered/query-data/influxql/explore-schema/)

### [Perform a basic InfluxQL query](/influxdb3/clustered/query-data/influxql/basic-query/)

A basic InfluxQL query that queries data from InfluxDB most commonly includes `SELECT`, `FROM`, and `WHERE` clauses.

```sql
SELECT temp, room FROM home WHERE time >= now() - 1d
```

[Read more](/influxdb3/clustered/query-data/influxql/basic-query/)

### [Aggregate data with InfluxQL](/influxdb3/clustered/query-data/influxql/aggregate-select/)

Use InfluxQL aggregate and selector functions to perform aggregate operations on your time series data.

##### Aggregate fields by groups

```sql
SELECT
  MEAN(temp) AS mean,
  FIRST(hum) as first,
FROM home
GROUP BY tag
```

##### Aggregate by time-based intervals

```sql
SELECT
  MEAN(temp),
  sum(hum),
FROM home
WHERE time >= now() - 24h
GROUP BY time(1h),room
```

[Read more](/influxdb3/clustered/query-data/influxql/aggregate-select/)

### [Troubleshoot InfluxQL errors](/influxdb3/clustered/query-data/influxql/troubleshoot/)

Learn how to troubleshoot and fix common InfluxQL errors.

### [Use parameterized queries with InfluxQL](/influxdb3/clustered/query-data/influxql/parameterized-queries/)

Use parameterized queries to prevent injection attacks and make queries more reusable.

##### Using Go and the influxdb3-go client

```go
// Use the $parameter syntax to reference parameters in a query.
// The following InfluxQL query contains $room and $min_time parameters.
query := `
    SELECT * FROM home
    WHERE time >= $min_time
      AND temp >= $min_temp
      AND room = $room`

// Assign parameter names to input values.
parameters := influxdb3.QueryParameters{
        "room": "Kitchen",
        "min_temp": 20.0,
        "min_time": "2024-03-18 00:00:00.00",
}

// Call the client's function to query InfluxDB with parameters and the
// the InfluxQL QueryType.
iterator, err := client.QueryWithParameters(context.Background(),
  query,
  parameters,
  influxdb3.WithQueryType(influxdb3.InfluxQL))
```

[Read more](/influxdb3/clustered/query-data/influxql/parameterized-queries/)

[query](/influxdb3/clustered/tags/query/) [influxql](/influxdb3/clustered/tags/influxql/)
