# Convert MySQL query to elasticsearch

**URL:** <https://discuss.elastic.co/t/convert-mysql-query-to-elasticsearch/40830>\
**Category:** Kibana\
**Created:** [February 3, 2016, 7:32am UTC](https://discuss.elastic.co/t/convert-mysql-query-to-elasticsearch/40830 "2016-02-03T07:32:57Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Croos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/croos/32/29489_2.png) [@Croos](https://discuss.elastic.co/u/Croos)\
**Post date:** [February 9, 2016, 5:56am UTC](https://discuss.elastic.co/t/convert-mysql-query-to-elasticsearch/40830/8 "2016-02-09T05:56:18Z")

</div>

Thanks a lot Bragin,  
You got my question. Now I understand the [scripted field](https://www.elastic.co/guide/en/kibana/current/managing-fields.html#create-scripted-field) based on data from a single document and had a idea about Date Histogram. As you mentioned, My case is need to go across document. Now my question is how to get the `maximum` and `minimum` value of a field from across document? Would you please explain me a little bit detail.

---

_[View the full topic](https://discuss.elastic.co/t/convert-mysql-query-to-elasticsearch/40830)._
