# How to transform the sql to es request body

**URL:** <https://discuss.elastic.co/t/how-to-transform-the-sql-to-es-request-body/88447>\
**Category:** Elasticsearch\
**Created:** [June 6, 2017, 5:09pm UTC](https://discuss.elastic.co/t/how-to-transform-the-sql-to-es-request-body/88447 "2017-06-06T17:09:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruce\_lo](https://avatars.discourse-cdn.com/v4/letter/b/ac8455/32.png) [@bruce\_lo](https://discuss.elastic.co/u/bruce_lo)\
**Post date:** [June 6, 2017, 5:09pm UTC](https://discuss.elastic.co/t/how-to-transform-the-sql-to-es-request-body/88447/1 "2017-06-06T17:09:28Z")

</div>

Hello. I have sql like this:

```auto
select (case when avg(column0) > 1 then column1 else 333 end) from demo 

```

How transform it to the es request searching body.  
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:** [July 4, 2017, 5:09pm UTC](https://discuss.elastic.co/t/how-to-transform-the-sql-to-es-request-body/88447/2 "2017-07-04T17:09:56Z")

</div>

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