# Union query

**URL:** <https://discuss.elastic.co/t/union-query/218192>\
**Category:** Elasticsearch\
**Created:** [February 6, 2020, 2:16pm UTC](https://discuss.elastic.co/t/union-query/218192 "2020-02-06T14:16:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mehmetozalp](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@mehmetozalp](https://discuss.elastic.co/u/mehmetozalp)\
**Post date:** [February 6, 2020, 2:16pm UTC](https://discuss.elastic.co/t/union-query/218192/1 "2020-02-06T14:16:08Z")

</div>

Hi can i do this query in elasticsearch? My elasticsearch is last version. Thank you.

```
    (SELECT * FROM images where file_id = 0)

UNION

(SELECT * FROM images where file_id > 0 Group by image_path,file_id)

LIMIT 20,20
```

---

<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:** [February 7, 2020, 10:11am UTC](https://discuss.elastic.co/t/union-query/218192/2 "2020-02-07T10:11:52Z")

</div>

Union queries are not supported currently by ES-SQL.  
There is an [open issue](https://github.com/elastic/elasticsearch/issues/34414) to track this feature.

---

<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:** [March 6, 2020, 10:12am UTC](https://discuss.elastic.co/t/union-query/218192/3 "2020-03-06T10:12:02Z")

</div>

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