# \#sql

**URL:** https://community.influxdata.com/tag/sql/137.md

[Latest](https://community.influxdata.com/latest.md) · [Categories](https://community.influxdata.com/categories.md) · [Tags](https://community.influxdata.com/tags.md)

---

## [Aggregate/Group Data in Grafana with SQL](https://community.influxdata.com/t/aggregate-group-data-in-grafana-with-sql/58717)

<div class="topic-metadata">

**Author:** [@dominik.w](https://community.influxdata.com/u/dominik.w)\
**Replies:** 2\
**Last updated:** [September 2, 2026, 7:11am UTC](https://community.influxdata.com/t/aggregate-group-data-in-grafana-with-sql/58717 "2026-09-02T07:11:40Z")

</div>

Hi, I am using Influxdb3 to Store data from my Data logger. Writing to it with the following line Protocol spine,point=a\_voltage,unit=V value=230.5 171234567890123456 works fine. Currently I write multiple points ever…

---

## [Problem with mapping SQL timestamp with InfluxDB time in Telegraf](https://community.influxdata.com/t/problem-with-mapping-sql-timestamp-with-influxdb-time-in-telegraf/58342)

<div class="topic-metadata">

**Author:** [@Michal1211](https://community.influxdata.com/u/Michal1211)\
**Replies:** 2\
**Last updated:** [March 9, 2026, 3:00pm UTC](https://community.influxdata.com/t/problem-with-mapping-sql-timestamp-with-influxdb-time-in-telegraf/58342 "2026-03-09T15:00:01Z")

</div>

Hi, I am trying to migrate data from MSSQL to InfluxDB for testing purpose. I have set up entire telegraf config but still have a problem with mapping “time\_event” field from MSSQL to timestamp in InfluxDB. Format from…

---

## [Multicast communication is not being stored in procstat\_socket](https://community.influxdata.com/t/multicast-communication-is-not-being-stored-in-procstat-socket/58294)

<div class="topic-metadata">

**Author:** [@PetrCh](https://community.influxdata.com/u/PetrCh)\
**Replies:** 0\
**Last updated:** [February 12, 2026, 3:46pm UTC](https://community.influxdata.com/t/multicast-communication-is-not-being-stored-in-procstat-socket/58294 "2026-02-12T15:46:48Z")

</div>

To whom it may concern, I am trying to monitor the network usage of a certain process using Telegraf — specifically, how many bytes a particular process sends and receives over the network. I am using Procstat input plu…

---

## [Query Error with COUNT in InfluxDB 3: "Exceed file limit of 432 parquet files"](https://community.influxdata.com/t/query-error-with-count-in-influxdb-3-exceed-file-limit-of-432-parquet-files/58184)

<div class="topic-metadata">

**Author:** [@Yuchen](https://community.influxdata.com/u/Yuchen)\
**Replies:** 1\
**Last updated:** [December 17, 2025, 10:15am UTC](https://community.influxdata.com/t/query-error-with-count-in-influxdb-3-exceed-file-limit-of-432-parquet-files/58184 "2025-12-17T10:15:54Z")

</div>

Hello everyone, I’m currently working with InfluxDB 3 and encountering an issue when trying to count the total number of rows in a table. When I run a simple query like: SELECT count(filed) FROM my\_table; I get the f…

---

## [Equivalent to Flux/increase() in InfluxDB 3 SQL?](https://community.influxdata.com/t/equivalent-to-flux-increase-in-influxdb-3-sql/58003)

<div class="topic-metadata">

**Author:** [@webwurst](https://community.influxdata.com/u/webwurst)\
**Replies:** 3\
**Last updated:** [December 4, 2025, 11:40am UTC](https://community.influxdata.com/t/equivalent-to-flux-increase-in-influxdb-3-sql/58003 "2025-12-04T11:40:39Z")

</div>

From the flux documentation: The primary use case for increase() is tracking changes in counter values which may wrap overtime when they hit a threshold or are reset. In the case of a wrap/reset, increase() assumes tha…

---

## [Fill data with last value before time range](https://community.influxdata.com/t/fill-data-with-last-value-before-time-range/58134)

<div class="topic-metadata">

**Author:** [@jhoos70](https://community.influxdata.com/u/jhoos70)\
**Replies:** 1\
**Last updated:** [December 1, 2025, 8:57pm UTC](https://community.influxdata.com/t/fill-data-with-last-value-before-time-range/58134 "2025-12-01T20:57:30Z")

</div>

I am coming from InfluxDB 2 with Flux and try to switch to InfluxDB 3 with SQL and struggle a little bit with the possibilities SQL offers or doesn´t offer. In a Grafana visualisation you often want to fill a gap at the …

---

## [I’m developing a cloud-based SCADA application that integrates with InfluxDB for time-series data storage and visualization. The platform will provide user profiles, live dashboards, and real-time analytics for industrial automation data.](https://community.influxdata.com/t/i-m-developing-a-cloud-based-scada-application-that-integrates-with-influxdb-for-time-series-data-storage-and-visualization-the-platform-will-provide-user-profiles-live-dashboards-and-real-time-analytics-for-industrial-automation-data/57602)

<div class="topic-metadata">

**Author:** [@BUDDHABHUSHAN23](https://community.influxdata.com/u/BUDDHABHUSHAN23)\
**Replies:** 0\
**Last updated:** [July 14, 2025, 3:59pm UTC](https://community.influxdata.com/t/i-m-developing-a-cloud-based-scada-application-that-integrates-with-influxdb-for-time-series-data-storage-and-visualization-the-platform-will-provide-user-profiles-live-dashboards-and-real-time-analytics-for-industrial-automation-data/57602 "2025-07-14T15:59:19Z")

</div>

I’m developing a cloud-based SCADA application that integrates with InfluxDB for time-series data storage and visualization. The platform will provide user profiles, live dashboards, and real-time analytics for industria…

---

## [Basic SELECT clauses not working with GROUP BY](https://community.influxdata.com/t/basic-select-clauses-not-working-with-group-by/56981)

<div class="topic-metadata">

**Author:** [@aep-sunlife](https://community.influxdata.com/u/aep-sunlife)\
**Replies:** 2\
**Last updated:** [April 15, 2025, 7:13pm UTC](https://community.influxdata.com/t/basic-select-clauses-not-working-with-group-by/56981 "2025-04-15T19:13:25Z")

</div>

InfluxDB keeps rejecting GROUP BY queries with various SELECT clauses. SELECT "path","used\_percent" FROM "disk" GROUP BY "path"; Error while planning query: Error during planning: Projection references non-aggregate va…

---

## [Strange SQL syntax highlighting](https://community.influxdata.com/t/strange-sql-syntax-highlighting/56980)

<div class="topic-metadata">

**Author:** [@aep-sunlife](https://community.influxdata.com/u/aep-sunlife)\
**Replies:** 1\
**Last updated:** [April 15, 2025, 7:11pm UTC](https://community.influxdata.com/t/strange-sql-syntax-highlighting/56980 "2025-04-15T19:11:48Z")

</div>

The Web SQL client is highlighting SQL queries in strange ways: Here, it highlights the first word GROUP in a GROUP BY expression rather than both GROUP and BY.

---

## [Quirks in telemetry fields](https://community.influxdata.com/t/quirks-in-telemetry-fields/56978)

<div class="topic-metadata">

**Author:** [@aep-sunlife](https://community.influxdata.com/u/aep-sunlife)\
**Replies:** 1\
**Last updated:** [April 15, 2025, 6:46pm UTC](https://community.influxdata.com/t/quirks-in-telemetry-fields/56978 "2025-04-15T18:46:49Z")

</div>

Fields are quite strange in InfluxDB. On the one hand, they are required. On they other, they are not useful in complex SQL queries, as they lack support for some important operations such as GROUP BY. Can we please a…

---

## [Query multiple buckets with SQL](https://community.influxdata.com/t/query-multiple-buckets-with-sql/56771)

<div class="topic-metadata">

**Author:** [@JamesD](https://community.influxdata.com/u/JamesD)\
**Replies:** 1\
**Last updated:** [March 18, 2025, 10:25pm UTC](https://community.influxdata.com/t/query-multiple-buckets-with-sql/56771 "2025-03-18T22:25:48Z")

</div>

I’m trying to use SQL a bit more, since that seems to be the direction for v3. In flux I can do this in Grafana: bucket1heartbeat = from(bucket: “bucket1”) |\> range(start: v.timeRangeStart, stop: v.timeRangeStop) |\> …

---

## [How to Handle Nonexistent Tags in InfluxDB Cloud v3 with SQL and Grafana?](https://community.influxdata.com/t/how-to-handle-nonexistent-tags-in-influxdb-cloud-v3-with-sql-and-grafana/56157)

<div class="topic-metadata">

**Author:** [@Ricko](https://community.influxdata.com/u/Ricko)\
**Replies:** 1\
**Last updated:** [January 28, 2025, 7:18pm UTC](https://community.influxdata.com/t/how-to-handle-nonexistent-tags-in-influxdb-cloud-v3-with-sql-and-grafana/56157 "2025-01-28T19:18:30Z")

</div>

Hi everyone, I’m facing an issue while migrating from InfluxQL to InfluxDB SQL (Cloud v3). Here’s the situation: In my database, I have a tag mytag that might not exist yet because no data has been inserted with this t…

---

## [Outputs.sql configuration for mysql db](https://community.influxdata.com/t/outputs-sql-configuration-for-mysql-db/49300)

<div class="topic-metadata">

**Author:** [@ali4niaki](https://community.influxdata.com/u/ali4niaki)\
**Replies:** 4\
**Last updated:** [January 3, 2025, 10:51pm UTC](https://community.influxdata.com/t/outputs-sql-configuration-for-mysql-db/49300 "2025-01-03T22:51:30Z")

</div>

Hi. I am trying to send a simple mock sin wave to mysql db using outputs.sql plugin. I get this error: \[agent\] Error writing to outputs.sql: execution failed: Error 1064 (42000): You have an error in your SQL syntax; c…

---

## [Failed to apply SQL migrations - database is locked](https://community.influxdata.com/t/failed-to-apply-sql-migrations-database-is-locked/39674)

<div class="topic-metadata">

**Author:** [@ksl28](https://community.influxdata.com/u/ksl28)\
**Replies:** 2\
**Last updated:** [December 9, 2024, 7:50pm UTC](https://community.influxdata.com/t/failed-to-apply-sql-migrations-database-is-locked/39674 "2024-12-09T19:50:32Z")

</div>

Hey :slight\_smile: I am using a helm chart (influxdata/influxdb2) to install my InfluxDB, with these custom values: image: repository: influxdb tag: 2.7.4-alpine pullPolicy: IfNotPresent service: type: LoadBal…

---

## [How to select multiple variables in one graph in influxdb cloud?](https://community.influxdata.com/t/how-to-select-multiple-variables-in-one-graph-in-influxdb-cloud/39020)

<div class="topic-metadata">

**Author:** [@Andrzej\_Borkowski](https://community.influxdata.com/u/Andrzej_Borkowski)\
**Replies:** 0\
**Last updated:** [October 30, 2024, 2:30pm UTC](https://community.influxdata.com/t/how-to-select-multiple-variables-in-one-graph-in-influxdb-cloud/39020 "2024-10-30T14:30:23Z")

</div>

Hi I used to do it like this in oss:

---

## [JMeter, Influx2, and InfluxQL](https://community.influxdata.com/t/jmeter-influx2-and-influxql/38881)

<div class="topic-metadata">

**Author:** [@peecee](https://community.influxdata.com/u/peecee)\
**Replies:** 3\
**Last updated:** [October 29, 2024, 1:20pm UTC](https://community.influxdata.com/t/jmeter-influx2-and-influxql/38881 "2024-10-29T13:20:06Z")

</div>

Hiya, I am running into issues with Influxql and the time field. I tried to make a subquery using the time field, but I’ve run into errors (because time cannot be selected as a scalar?). I am using the JMeter influx dr…

---

## [Telegraf Postgres SQL output plugin misbehaviour](https://community.influxdata.com/t/telegraf-postgres-sql-output-plugin-misbehaviour/35299)

<div class="topic-metadata">

**Author:** [@Nistha](https://community.influxdata.com/u/Nistha)\
**Replies:** 9\
**Last updated:** [September 5, 2024, 2:12pm UTC](https://community.influxdata.com/t/telegraf-postgres-sql-output-plugin-misbehaviour/35299 "2024-09-05T14:12:28Z")

</div>

I’m trying postgres output plugin on telegraf 1.31.0. Scenario: drop a PSQL table while telegraf is running Expected behavior: telegraf should be able to recreate the table if it does not exists Actual behavior: Teleg…

---

## [Last\_value and first\_value NOT WORKING](https://community.influxdata.com/t/last-value-and-first-value-not-working/34433)

<div class="topic-metadata">

**Author:** [@FrankBenjamin](https://community.influxdata.com/u/FrankBenjamin)\
**Replies:** 1\
**Last updated:** [June 3, 2024, 8:44pm UTC](https://community.influxdata.com/t/last-value-and-first-value-not-working/34433 "2024-06-03T20:44:20Z")

</div>

last\_value and first\_value returns this error: Error while planning query: type\_coercion caused by Error during planning: Coercion from \[Utf8\] to the signature OneOf(\[ArraySignature(Array), Uniform(1, \[Int8, Int16, Int3…

---

## [Change Flux to SQL sync](https://community.influxdata.com/t/change-flux-to-sql-sync/34240)

<div class="topic-metadata">

**Author:** [@mahitsy](https://community.influxdata.com/u/mahitsy)\
**Replies:** 2\
**Last updated:** [May 16, 2024, 9:15am UTC](https://community.influxdata.com/t/change-flux-to-sql-sync/34240 "2024-05-16T09:15:49Z")

</div>

Hello, I am encountering a problem for which I couldn’t find much information online… I had created a test account to get familiar with the technology and understand how it works. I was able to successfully create diff…

---

## [Join SQL and InfluxDB data](https://community.influxdata.com/t/join-sql-and-influxdb-data/34019)

<div class="topic-metadata">

**Author:** [@steph2795](https://community.influxdata.com/u/steph2795)\
**Replies:** 12\
**Last updated:** [April 25, 2024, 7:00am UTC](https://community.influxdata.com/t/join-sql-and-influxdb-data/34019 "2024-04-25T07:00:26Z")

</div>

Hi, I’m trying to join series in my Influx DB and data relative to series from an SQL DB. import "sql" import "join" measuresInfos = sql.from( driverName: "sqlserver", dataSourceName: "sqlserver://user:psswd@i…

---

## [How to duplicate measurement values from one day to another](https://community.influxdata.com/t/how-to-duplicate-measurement-values-from-one-day-to-another/34014)

<div class="topic-metadata">

**Author:** [@galaxy](https://community.influxdata.com/u/galaxy)\
**Replies:** 1\
**Last updated:** [April 22, 2024, 3:49pm UTC](https://community.influxdata.com/t/how-to-duplicate-measurement-values-from-one-day-to-another/34014 "2024-04-22T15:49:57Z")

</div>

Hi, running influx 1.8.1 Problem: system was down for a few days, and now there is a hole in the graphs. (just some temperature, humidity etc values) Is there an easy way to take the data of the last working day A, an…

---

## [SQL / InfluxQL time zone settings](https://community.influxdata.com/t/sql-influxql-time-zone-settings/32919)

<div class="topic-metadata">

**Author:** [@Torakiki73](https://community.influxdata.com/u/Torakiki73)\
**Replies:** 11\
**Last updated:** [April 17, 2024, 8:26pm UTC](https://community.influxdata.com/t/sql-influxql-time-zone-settings/32919 "2024-04-17T20:26:51Z")

</div>

Hello everyone, my first post here :slight\_smile: Trying to figure out the things I can do with the Iox engine, and the very first thing that I think I’m missing is how to set up the session time zone for a query. For…

---

## [Generate one table for each row of another table](https://community.influxdata.com/t/generate-one-table-for-each-row-of-another-table/33157)

<div class="topic-metadata">

**Author:** [@brimstone](https://community.influxdata.com/u/brimstone)\
**Replies:** 0\
**Last updated:** [February 9, 2024, 10:41am UTC](https://community.influxdata.com/t/generate-one-table-for-each-row-of-another-table/33157 "2024-02-09T10:41:29Z")

</div>

Hi, I’m currently trying to solve a problem with Flux and SQL. I have a SQL Database, where I’m filtering for a specific criteria, which corresponds to multiple Sensors with a SensorID each and one or many portnumber(s)…

---

## [SQL / InfluxQL weighted average](https://community.influxdata.com/t/sql-influxql-weighted-average/32920)

<div class="topic-metadata">

**Author:** [@Torakiki73](https://community.influxdata.com/u/Torakiki73)\
**Replies:** 2\
**Last updated:** [January 30, 2024, 11:04am UTC](https://community.influxdata.com/t/sql-influxql-weighted-average/32920 "2024-01-30T11:04:55Z")

</div>

Hello, in case my data points are irregular with their timestamp, would it be possible to calculate a weighted average instead of a simple average, in order to give the values the right weight, depending on how much tim…

---

## [Published my First Udemy Course covering InfluxDB3.0 and InfluxDB2.0](https://community.influxdata.com/t/published-my-first-udemy-course-covering-influxdb3-0-and-influxdb2-0/31948)

<div class="topic-metadata">

**Author:** [@Persist](https://community.influxdata.com/u/Persist)\
**Replies:** 2\
**Last updated:** [October 26, 2023, 5:01pm UTC](https://community.influxdata.com/t/published-my-first-udemy-course-covering-influxdb3-0-and-influxdb2-0/31948 "2023-10-26T17:01:39Z")

</div>

Udemy Course on InfluxDB2.0 and InfluxDB3.0 Easily Master the TOP 3 Databases - MongoDB,Redis,InfluxDB Has Usecases , Architectures, V2.0 & V3.0 Covered along with Practical Interview Questions

---

## [InfluxDB - retrieving a table from SQL Server (returns only the last row)](https://community.influxdata.com/t/influxdb-retrieving-a-table-from-sql-server-returns-only-the-last-row/31941)

<div class="topic-metadata">

**Author:** [@pak\_vit](https://community.influxdata.com/u/pak_vit)\
**Replies:** 6\
**Last updated:** [October 25, 2023, 8:23am UTC](https://community.influxdata.com/t/influxdb-retrieving-a-table-from-sql-server-returns-only-the-last-row/31941 "2023-10-25T08:23:26Z")

</div>

Hi, I am fairly new to InfluxDB and Telegraph. I’m having trouble configuring the “SQL” plugin in Telegraf. I have a query: SELECT CustomerID as ID, FirstName, LastName, GETDATE() AS Timestamp FROM \[AdventureWorksLT\].…

---

## [How to aggregate data by week or by month using SQL](https://community.influxdata.com/t/how-to-aggregate-data-by-week-or-by-month-using-sql/31156)

<div class="topic-metadata">

**Author:** [@grant1](https://community.influxdata.com/u/grant1)\
**Replies:** 2\
**Last updated:** [August 23, 2023, 11:53pm UTC](https://community.influxdata.com/t/how-to-aggregate-data-by-week-or-by-month-using-sql/31156 "2023-08-23T23:53:20Z")

</div>

I have this query running fine in the FlightSQL plugin for Grafana which shows the electricity demand by hour (the data is collected every hour and the value represents the electricity demand for that hour): SELECT \* FR…

---

## [Strange behaviour of Sub-(Queries) with OFFSET](https://community.influxdata.com/t/strange-behaviour-of-sub-queries-with-offset/31155)

<div class="topic-metadata">

**Author:** [@fuetti](https://community.influxdata.com/u/fuetti)\
**Replies:** 2\
**Last updated:** [August 23, 2023, 11:55am UTC](https://community.influxdata.com/t/strange-behaviour-of-sub-queries-with-offset/31155 "2023-08-23T11:55:07Z")

</div>

In my influx db I have wrong data I need to update. Therefore I am looking for spikes in my data and I am using OFFSET and LIMIT in a divide and conquer algorithm to find this spikes. Now I have strange results, that pr…

---

## [Converting from InfluxQL to SQL (flightSQL) in InfluxDB 3.0](https://community.influxdata.com/t/converting-from-influxql-to-sql-flightsql-in-influxdb-3-0/30219)

<div class="topic-metadata">

**Author:** [@Marti\_B](https://community.influxdata.com/u/Marti_B)\
**Replies:** 4\
**Last updated:** [June 13, 2023, 12:13pm UTC](https://community.influxdata.com/t/converting-from-influxql-to-sql-flightsql-in-influxdb-3-0/30219 "2023-06-13T12:13:25Z")

</div>

Hi, Up until now I was selfhosting InfluxDB 2 but we are now migrating to InfluxDB 3 on AWS. As I understand it I cannot use InfluxQL. So I have this query which I’m trying to convert to SQL to be able to use the fligh…

---

## [sql.to() function not working in V2.4.0](https://community.influxdata.com/t/sql-to-function-not-working-in-v2-4-0/27868)

<div class="topic-metadata">

**Author:** [@FrankSONG](https://community.influxdata.com/u/FrankSONG)\
**Replies:** 3\
**Last updated:** [December 28, 2022, 1:56am UTC](https://community.influxdata.com/t/sql-to-function-not-working-in-v2-4-0/27868 "2022-12-28T01:56:50Z")

</div>

This Flux sql.to() function did not report any errors in V2.4, but the data was not written to PGSQL it is working in old V2.0.7. import “sql” data = from(bucket: “SEMW”) |\> range(start: v.timeRangeStart, stop: v.ti…

[Next page](https://community.influxdata.com/tag/sql/137.md?match_all_tags=true&page=1&tags%5B%5D=sql)
