0

I have a statement like so...

SELECT * FROM FOO_TABLE WHERE ID = 1;

What I want is to be able to supply multiple ID's without having to AND. So for example....

SELECT * FROM FOO_TABLE WHERE ID = 1,2,3,4 or (1,2,3,4).

Something along those lines. Is this possible?

1 Answer 1

2

From the link:

sqlite

SELECT id, . FROM additionalchunks WHERE id in (? ? ? ? ? .)

works, and works efficiently (with an index) :)

Sign up to request clarification or add additional context in comments.

3 Comments

I'm afraid I'm getting a syntax error from this when I try and insert values instead of the ? placeholder?
Hmm, try something like SELECT * FROM COMPANY WHERE AGE IN ( 25, 27 ); , from [tutorialspoint.com/sqlite/sqlite_where_clause.htm]
Nice work. Thank you for taking the time to help me. Couldn't find it myself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.