SQLite查询

时间:2009-07-13 09:33:26

标签: sqlite

我想根据多个限制从表中选择一些记录 我希望得到的记录在一个范围内<或者> 我怎样才能在SQLite中编写这样的查询.....?

2 个答案:

答案 0 :(得分:3)

我相信SQLite理解的SQL方言是相当标准的,所以你可以编写一个查询,例如这个例子:

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

答案 1 :(得分:1)

如果您想查询范围,可以使用between运算符:

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

正如teabot所述,SQLite使用了一个非常标准的SQL版本,所有通常的条款都是有效的。