# JDBC Limit equivalent?

**URL:** <https://discuss.elastic.co/t/jdbc-limit-equivalent/290346>\
**Category:** Logstash\
**Created:** [November 27, 2021, 9:01pm UTC](https://discuss.elastic.co/t/jdbc-limit-equivalent/290346 "2021-11-27T21:01:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rojin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rojin/32/97697_2.png) [@rojin](https://discuss.elastic.co/u/rojin)\
**Post date:** [November 27, 2021, 9:01pm UTC](https://discuss.elastic.co/t/jdbc-limit-equivalent/290346/1 "2021-11-27T21:01:47Z")

</div>

Hi! I was wondering what would be the equivalent of the limit in JDBC static? it does not accept the limit 10 in my query string.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [November 28, 2021, 12:15am UTC](https://discuss.elastic.co/t/jdbc-limit-equivalent/290346/2 "2021-11-28T00:15:31Z")

</div>

LIMIT is part of the syntax, perhaps I am confused.

See here

> **[SELECT | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-syntax-select.html#sql-syntax-select)**

> If the LIMIT or TOP is specified (cannot use both in the same query), the SELECT statement only returns a subset of the result rows. (See LIMIT Clause and TOP clause below.)

---

<div class="post-metadata">

**Author:** ![rojin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rojin/32/97697_2.png) [@rojin](https://discuss.elastic.co/u/rojin)\
**Post date:** [November 28, 2021, 5:44am UTC](https://discuss.elastic.co/t/jdbc-limit-equivalent/290346/3 "2021-11-28T05:44:59Z")

</div>

None of them worked for my query.

> [@JDBC - SQL Query Issue](https://discuss.elastic.co/t/jdbc-sql-query-issue/290345):
>
> Hi! I have a database in MySQL and I want to fetch some info based on IP addresses I get from my client logs. There are ip\_from(VARCHAR 50), ip\_to(VARCHAR 50), ip\_from\_int(INT 10), and ip\_to\_int(INT 10) plus a name(VARCHAR 255) column in my desired table. I have written the filter as below and I want to fetch the name if the IP address is between ip\_from and ip\_to. But it keeps telling me that it cannot recognize INET\_ATON as a function in JDBC. Is there a way I can get my result? the "clientip"…

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [November 28, 2021, 6:31am UTC](https://discuss.elastic.co/t/jdbc-limit-equivalent/290346/4 "2021-11-28T06:31:18Z")

</div>

Please do not open multiple threads on the same topic, this seems the same / related to the other topic.

The answer I gave above is for querying Elasticsearch with SQL but it seems that you're trying to use the JDBC connector in logstash.

---

<div class="post-metadata">

**Author:** ![rojin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rojin/32/97697_2.png) [@rojin](https://discuss.elastic.co/u/rojin)\
**Post date:** [November 28, 2021, 6:35am UTC](https://discuss.elastic.co/t/jdbc-limit-equivalent/290346/5 "2021-11-28T06:35:09Z")

</div>

Yes, and I have issues getting my data using the connector.

---

<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:** [December 26, 2021, 6:36am UTC](https://discuss.elastic.co/t/jdbc-limit-equivalent/290346/6 "2021-12-26T06:36:04Z")

</div>

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