Hasnain
Hasnain

Reputation:

SQLite Queries

I want to select some records from a table depending on multiple limitations like i want to get records which lies in a range < OR > how can i write such query in SQLite.....?

Upvotes: 0

Views: 1580

Answers (2)

Stephen Darlington
Stephen Darlington

Reputation: 52575

If you want to query a range you can use the between operator:

select col from Table where col2 between ? and ? order by col3

As teabot notes, SQLite uses a pretty standard version of SQL and all the usual clauses are valid.

Upvotes: 1

teabot
teabot

Reputation: 15444

I believe that the SQL dialect understood by SQLite is fairly standard so you can write a query such as this made-up example:

SELECT name, age, type
FROM pets
WHERE age < 2 OR age > 12 AND name LIKE "Mr%" AND type IN ("cat", "dog")

Upvotes: 3

Related Questions