# Group by clause

**URL:** <https://discuss.elastic.co/t/group-by-clause/12296>\
**Category:** Elasticsearch\
**Created:** [June 6, 2013, 1:23pm UTC](https://discuss.elastic.co/t/group-by-clause/12296 "2013-06-06T13:23:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankit\_Jain](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@Ankit\_Jain](https://discuss.elastic.co/u/Ankit_Jain)\
**Post date:** [June 6, 2013, 1:23pm UTC](https://discuss.elastic.co/t/group-by-clause/12296/1 "2013-06-06T13:23:44Z")

</div>

Hi All,

I would like to know about the support of group by clause in Elasticsearch.

Below is the sample query that we are currently firing in MySQL.

select column\_name, aggregate\_function(column\_name)  
from table  
where column\_name operator value  
Group by column\_name

Please share ways to achieve the support of above query in elasticsearch.

Thanks,  
Ankit

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Michael\_Sick](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@Michael\_Sick](https://discuss.elastic.co/u/Michael_Sick)\
**Post date:** [June 6, 2013, 2:11pm UTC](https://discuss.elastic.co/t/group-by-clause/12296/2 "2013-06-06T14:11:43Z")

</div>

Ankit,

Check out the Facet API -  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/facets/) See the  
various types of facets down the right side of the page. Good luck!

--Mike

On Thu, Jun 6, 2013 at 9:23 AM, Ankit Jain [ankitjaincs06@gmail.com](mailto:ankitjaincs06@gmail.com) wrote:

> Hi All,
> 
> I would like to know about the support of group by clause in Elasticsearch.
> 
> Below is the sample query that we are currently firing in MySQL.
> 
> select column\_name, aggregate\_function(column\_name)  
> from table  
> where column\_name operator value  
> Group by column\_name
> 
> Please share ways to achieve the support of above query in elasticsearch.
> 
> Thanks,  
> Ankit
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:32am UTC](https://discuss.elastic.co/t/group-by-clause/12296/3 "2017-07-06T02:32:36Z")

</div>


