Mohammad Seyedmahmudi
Mohammad Seyedmahmudi

Reputation: 157

SQLite query: between

I am using SQLit in my Android app, I want to search in my database.

my query and error is this :

              Error Code : 1 (SQLITE_ERROR)
              Caused By : SQL(query) error or missing database.
                near "to": syntax error (code 1): , while compiling:
select * from informations where house_type = 'آپارتمانی' and room_count = '1' and (cost between 0 to 100000000) and (area between 0 to 1000)

anybody knows what is the problem ?

Upvotes: 1

Views: 43

Answers (1)

PeterDeV
PeterDeV

Reputation: 203

The syntax for the BETWEEN operator is test_expression BETWEEN low_expression AND high_expression. So change TO in AND.

Upvotes: 1

Related Questions