I do not really shave in the database, although the question seems to me simple:

Suppose there is a SQLite table of this type:

id text

1 blah blah

2 blah blah

3 blah blah blah

4 blah blah blah

5 blah blah blah

For example, I need to select from it records with the number 1,2,4. How can I do this in one request?

I tried something like:

SELECT * FROM table_name WHERE id = (1,2,4)

but it does not work



    2 answers 2

    Here you need to use the keyword IN , i.e. value is in the set.

    SELECT * FROM table_name WHERE id IN (1,2,4); 
    • thanks, works with a bang - Roman Zakharov
     SELECT * FROM table_name WHERE id=1 OR id=2 OR id=4