SQL "IN" Clause
See original GitHub issueIs there any support for the SQL IN clause?
Database.test() .select("select score from person where name IN (?)") .parameters("FRED", "JOSEPH") // or a list of Strings .getAs(Integer.class) .blockingForEach(System.out::println);
I tried a bunch of different ways and I couldn’t figure how I could possibly make it work.
Thank you in advance for your time!
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
SQL IN Operator - W3Schools
CustomerID CustomerName ContactName Address
1 Alfreds Futterkiste Maria Anders Obere Str. 57
2 Ana Trujillo Emparedados y helados Ana Trujillo Avda. de la Constitución...
3 Antonio...
Read more >SQL: IN Condition
The SQL IN condition (sometimes called the IN operator) allows you to easily test if an expression matches any value in a list...
Read more >SQL IN Operator - TutorialsTeacher
The IN operator is used to specify the list of values or sub query in the WHERE clause. A sub-query or list of...
Read more >SQL WHERE IN | NOT IN - Dofactory
WHERE IN returns values that match values in a list. This list is either hardcoded or generated by a subquery. WHERE IN is...
Read more >Clause in SQL - Types with Syntax and Example - DataFlair
Clauses are in-built functions available to us in SQL. With the help of clauses, we can deal with data easily stored in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

You seem to have missed my point. I’ll explain the workaround. I’m not talking about the originally suggested hack which would not work because of protection from sql injection but rather of modifying the sql (not the parameters). Here’s an example.
The full implementation in the api for this will take me a little while (not a quick fix) but would be good to have and with luck I’ll get to it soon but in the meantime you have the above style of workaround.
By the way, many databases have quite low limits for the number of parameters in a sql statement. Oracle used to be about 1000. I think I’ve used 20,000 with H2.
Beaut, let me know if more docs needed too