# GROUP BY SQL returns no data

**URL:** <https://discuss.elastic.co/t/group-by-sql-returns-no-data/239347>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-sql\
**Created:** [June 30, 2020, 4:47pm UTC](https://discuss.elastic.co/t/group-by-sql-returns-no-data/239347 "2020-06-30T16:47:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbuzz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dbuzz/32/45326_2.png) [@dbuzz](https://discuss.elastic.co/u/dbuzz)\
**Post date:** [June 30, 2020, 4:47pm UTC](https://discuss.elastic.co/t/group-by-sql-returns-no-data/239347/1 "2020-06-30T16:47:04Z")

</div>

Hey ALL,

I am running simple SQL in the Kibana SQL workspace and getting no data back. Appreciate for any clues!

`select status, count(*) as status_cnt from my-index4 group by status`

Thanks,  
Dimon.

---

<div class="post-metadata">

**Author:** ![matriv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matriv/32/43656_2.png) [@matriv](https://discuss.elastic.co/u/matriv)\
**Post date:** [July 2, 2020, 1:38pm UTC](https://discuss.elastic.co/t/group-by-sql-returns-no-data/239347/2 "2020-07-02T13:38:30Z")

</div>

Have you tried to run the query using the [SQL REST api](https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-rest-overview.html)?

Can you try to put the index name in double quotes:

```auto
select status, count(*) as status_cnt from "my-index4" group by status

```

(keep in mind in REST API - json - you need to escape the double quotes with `\`:

```auto
"query" : "select status, count(*) as status_cnt from \"my-index4\" group by status"

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 30, 2020, 1:38pm UTC](https://discuss.elastic.co/t/group-by-sql-returns-no-data/239347/3 "2020-07-30T13:38:32Z")

</div>

Closed on July 30, 2020, 1:38pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
