---
title: Query data with InfluxQL
description: Learn to use InfluxQL to query data in InfluxDB 3 Enterprise.
url: https://docs.influxdata.com/influxdb3/enterprise/query-data/influxql/
estimated_tokens: 2484
product: InfluxDB 3 Enterprise
version: enterprise
---

# Query data with InfluxQL

Learn to query data in InfluxDB 3 Enterprise using InfluxQL.

-   [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/enterprise/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/enterprise/query-data/influxql/explore-schema/)

### [Perform a basic InfluxQL query](/influxdb3/enterprise/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/enterprise/query-data/influxql/basic-query/)

### [Aggregate data with InfluxQL](/influxdb3/enterprise/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/enterprise/query-data/influxql/aggregate-select/)

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

Learn how to troubleshoot and fix common InfluxQL errors.

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

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

```sql
SELECT * FROM home
WHERE time >= $min_time
  AND temp >= $min_temp
  AND room = $room
```

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

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