Alex
Alex

Reputation: 847

SQLiteDatabase select rows where column is equal something

I have a SQLiteDatabase and I want to select the rows where one of the row's column is equal to a text. I know to do this with integer but I don't know how to do this with text. And I would like to have more options as WHERE theColumn is equal a or b or c.

Upvotes: 0

Views: 604

Answers (1)

m0skit0
m0skit0

Reputation: 25873

SELECT * FROM table WHERE theColumn IN ('text1', 'text2', 'text3')

Try to avoid selecting whole rows when not necessary. Also keep in mind string comparisons take longer than integer ones.

Upvotes: 1

Related Questions