# SELECT IN (SELECT, SELECT)

**URL:** <https://discuss.elastic.co/t/select-in-select-select/240495>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-sql\
**Created:** [July 9, 2020, 8:43am UTC](https://discuss.elastic.co/t/select-in-select-select/240495 "2020-07-09T08:43:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MatDemb](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@MatDemb](https://discuss.elastic.co/u/MatDemb)\
**Post date:** [July 9, 2020, 8:43am UTC](https://discuss.elastic.co/t/select-in-select-select/240495/1 "2020-07-09T08:43:09Z")

</div>

Hello,  
I try to extract some datas with SQL request in canvas but I don't find the way to do it with sql restriction essql has (and my poor experience on it).  
Here an example of data I have (each row is a document):  
_contener object_  
contener1 vase\_1  
contener1 vase\_2  
contener1 thing\_2  
contener1 thing\_3  
contener2 vase\_2  
contener2 vase\_3  
contener2 vase\_4  
contener2 thing\_1  
contener2 thing\_3

I want the "biggest" object for each contener:  
contener1 thing\_3  
contener2 vase\_4  
contener2 thing\_3

The first thing I tryed is to list objects with the biggest number (vase\_4 and thing\_3) and then show on wich contener they are.  
I can individually find the biggest object for each object name but I can't take them in a list and do a SELECT IN to have the final result.

Anyone know how to do that?  
Thanks

---

<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 6, 2020, 8:43am UTC](https://discuss.elastic.co/t/select-in-select-select/240495/2 "2020-08-06T08:43:16Z")

</div>

Closed on August 6, 2020, 8:43am UTC

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