---
title: SELECT statement
description: Use the SQL SELECT statement to query data from a measurement.
url: https://docs.influxdata.com/influxdb3/cloud-dedicated/reference/sql/select/
estimated_tokens: 948
publisher: InfluxData
canonical: https://docs.influxdata.com/influxdb3/cloud-dedicated/reference/sql/select/
date: '2025-04-03T12:43:17-06:00'
lastmod: '2025-04-03T12:43:17-06:00'
---

Use the `SELECT` statement to query data from an InfluxDB measurement.
The `SELECT` clause is required when querying data in SQL.

* [Syntax](#syntax)
* [Examples](#examples)

### Syntax

```sql
SELECT a, b, "time" FROM <measurement>
```

The SELECT clause supports the following:

* `SELECT *` - return all tags, fields and timestamps.
* `SELECT DISTINCT` to return all distinct (different) values.
* `SELECT <"field" or "tag">` - returns a specified field or tag.
* `SELECT <"field" or "tag">, <"field" or "tag">` - returns more than one tag or field.
* `SELECT <"field"> AS a `- return the field as the alias.

## Examples

The following examples use data from the NOAA database.
To download the NOAA test data see [NOAA water sample data](/influxdb/v2/reference/sample-data/#noaa-water-sample-data).

### Select all fields and tags from a measurement

```sql
SELECT * FROM h2o_feet LIMIT 10
```

[](#view-example-results)

View example results

|    level description    |  location   |          time          |water\_level|
|-------------------------|-------------|------------------------|------------|
|at or greater than 9 feet|coyote\_creek|2019-09-01T00:00:00.000Z|9.126144144 |
|at or greater than 9 feet|coyote\_creek|2019-09-01T00:06:00.000Z|   9.009    |
|  between 6 and 9 feet   |coyote\_creek|2019-09-01T00:12:00.000Z|   8.862    |
|  between 6 and 9 feet   |coyote\_creek|2019-09-01T00:18:00.000Z|   8.714    |

### Select specific tags and fields from a measurement

```sql
SELECT "location", "water_level" FROM "h2o_feet"
```

[](#view-example-results-1)

View example results

|  location   |water\_level|
|-------------|------------|
|coyote\_creek|9.126144144 |
|coyote\_creek|   9.009    |
|coyote\_creek|   8.862    |
|coyote\_creek|   8.714    |
|coyote\_creek|   8.547    |

### Select a field, tag and timestamp from a measurement

```sql
SELECT "water_level", "location", "time" FROM "h2o_feet"
```

[](#view-example-results-2)

View example results

|  location   |          time          |water\_level|
|-------------|------------------------|------------|
|coyote\_creek|2019-08-20T00:00:00.000Z|   8.638    |
|coyote\_creek|2019-08-20T00:06:00.000Z|   8.658    |
|coyote\_creek|2019-08-20T00:12:00.000Z|   8.678    |

### Select a field and perform basic arithmetic

The following query takes the value of water\_level, multiplies it by 3 and adds 5 to the result.

```sql
SELECT ("water_level" * 3) + 5 FROM "h2o_feet"
```

[](#view-example-results-3)

View example results

|   water\_level   |
|------------------|
|      30.128      |
|30.641000000000002|
|31.142000000000003|
|      31.586      |
|      32.027      |
|   32.378432432   |

#### Related

* [Subqueries](/influxdb3/cloud-dedicated/reference/sql/subqueries/)
| level description | location | time | water_level |
| --- | --- | --- | --- |
| level description | location | time | water_level |
| at or greater than 9 feet | coyote_creek | 2019-09-01T00:00:00.000Z | 9.126144144 |
| at or greater than 9 feet | coyote_creek | 2019-09-01T00:06:00.000Z | 9.009 |
| between 6 and 9 feet | coyote_creek | 2019-09-01T00:12:00.000Z | 8.862 |
| between 6 and 9 feet | coyote_creek | 2019-09-01T00:18:00.000Z | 8.714 |

| location | water_level |
| --- | --- |
| location | water_level |
| coyote_creek | 9.126144144 |
| coyote_creek | 9.009 |
| coyote_creek | 8.862 |
| coyote_creek | 8.714 |
| coyote_creek | 8.547 |

| location | time | water_level |
| --- | --- | --- |
| location | time | water_level |
| coyote_creek | 2019-08-20T00:00:00.000Z | 8.638 |
| coyote_creek | 2019-08-20T00:06:00.000Z | 8.658 |
| coyote_creek | 2019-08-20T00:12:00.000Z | 8.678 |

| water_level |
| --- |
| water_level |
| 30.128 |
| 30.641000000000002 |
| 31.142000000000003 |
| 31.586 |
| 32.027 |
| 32.378432432 |
