StuStirling
StuStirling

Reputation: 16221

SQLite Select Query Multiple Where Clause Values

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?

Upvotes: 0

Views: 457

Answers (1)

Binayaka Chakraborty
Binayaka Chakraborty

Reputation: 1335

From the link:

sqlite

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

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

Upvotes: 2

Related Questions