# No output when querying data from database using influxql

**URL:** <https://community.influxdata.com/t/no-output-when-querying-data-from-database-using-influxql/25326>\
**Category:** InfluxDB 2\
**Created:** [June 7, 2022, 2:32pm UTC](https://community.influxdata.com/t/no-output-when-querying-data-from-database-using-influxql/25326 "2022-06-07T14:32:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pratik\_Das\_Baghel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/pratik_das_baghel/32/5698_2.png) [@Pratik\_Das\_Baghel](https://community.influxdata.com/u/Pratik_Das_Baghel)\
**Post date:** [June 7, 2022, 2:32pm UTC](https://community.influxdata.com/t/no-output-when-querying-data-from-database-using-influxql/25326/1 "2022-06-07T14:32:32Z")

</div>

I am using ec2 instance on which i am running influxdb as docker container. Version of influxdb is 2.0, i want to query data using influxql. I have created the mapping of bucket required. Retention policy i mentioned was infinite.

Following is query i am using:

```auto
curl --request GET http://localhost:8086/query?db=db_name --header "Authorization: Token Token_id" --data-urlencode "q=SELECT * FROM db_name.measurement_name WHERE tag1=value1 AND tag2=value2 AND time >= '2022-06-06T07:00:00Z' AND time <= '2022-06-06T07:30:00Z'"

```

The output returned everytime is {}

I am sure that data is there for particular tag values and in that time duration by verifying in influxdb ui. Not sure what is the issue here. Can anyone help

---

<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:** [June 13, 2022, 8:09pm UTC](https://community.influxdata.com/t/no-output-when-querying-data-from-database-using-influxql/25326/2 "2022-06-13T20:09:36Z")

</div>

Hello @Pratik_Das_Baghel,  
Can you verify that you have:

1. data then?  
Try querying with Flux  
The equivalent Flux query would be:

```auto
from(bucket: "db_name")
  |> range(start: 2022-06-06T07:00:00Z, stop: 2022-06-06T07:30:00Z)
  |> filter(fn: (r) => r["_measurement"] == "measurement_name")
  |> filter(fn: (r) => r["tag1"] == "value1")
  |> filter(fn: (r) => r["tag2"] == "value2")
  |> yield(name: "my data")

```

As an aside, why do you need to query with InfluxQL? It might be easier to just query with Flux.  
The following posts might be helpful to you:

> **[%%title%%](https://www.influxdata.com/blog/tldr-influxdb-tech-tips-converting-influxql-queries-flux-queries/)**
>
> In this TL;DR, well convert common InfluxQL queries into Flux and identify patterns between the two languages to help you start using Flux.

> **[TL;DR InfluxDB Tech Tips — From Subqueries to Flux!](https://www.influxdata.com/blog/tldr-influxdb-tech-tips-from-subqueries-to-flux/)**
>
> In this post we translate subqueries, using InfluxQL in InfluxDB version 1.x, into Flux, a data scripting and functional query language.

1. A DBRP mapping

```auto
influx v1 dbrp list

```

Thanks!
