# Several selects in one query

**URL:** <https://discuss.elastic.co/t/several-selects-in-one-query/189337>\
**Category:** Elasticsearch\
**Tags:** canvas\
**Created:** [July 8, 2019, 11:48am UTC](https://discuss.elastic.co/t/several-selects-in-one-query/189337 "2019-07-08T11:48:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andreasky](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@Andreasky](https://discuss.elastic.co/u/Andreasky)\
**Post date:** [July 8, 2019, 11:48am UTC](https://discuss.elastic.co/t/several-selects-in-one-query/189337/1 "2019-07-08T11:48:11Z")

</div>

```
select ((select count(Call) from "log" where "Call" = 'answered') / (select count(Event) from "log"))

```

I'm trying to run this query in canvas, but i only get this error message:

```
[essql] > Unexpected error from Elasticsearch: [unsupported_operation_exception] null

```

When I run the same query in SQL it works fine. Does canvas support multiple SELECT in the same query?

---

<div class="post-metadata">

**Author:** ![tims](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tims/32/46750_2.png) [@tims](https://discuss.elastic.co/u/tims)\
**Post date:** [July 9, 2019, 6:19pm UTC](https://discuss.elastic.co/t/several-selects-in-one-query/189337/2 "2019-07-09T18:19:26Z")

</div>

Hi @Andreasky, unfortunately Canvas ES-SQL doesn't fully support every SQL operation. In this case subqueries are not supported in ES-SQL.

---

<div class="post-metadata">

**Author:** ![Andreasky](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@Andreasky](https://discuss.elastic.co/u/Andreasky)\
**Post date:** [July 10, 2019, 6:14am UTC](https://discuss.elastic.co/t/several-selects-in-one-query/189337/3 "2019-07-10T06:14:58Z")

</div>

Thank you for your answer. I used the aggregate filter in the logstash configuration file to extract the values, that way I didn't need the subqueries.

---

<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:** [August 7, 2019, 6:15am UTC](https://discuss.elastic.co/t/several-selects-in-one-query/189337/4 "2019-08-07T06:15:00Z")

</div>

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