SQLite的高级搜索 [英] Sqlite advanced search

查看:142
本文介绍了SQLite的高级搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个商店,它提供了许多功能的Andr​​oid应用程序。其中之一是一个功能,允许用户搜索一些标准(价格,大小,类型......像图片)的产品。

I'm developing an android application for a store, which provides many functions. One of these is a function that allows the customer to search a product with some criteria (price,size,type... like in the picture ).

我想我应该用 SqliteDatabase 工作,但我不知道我怎么能做出这种多标准搜索界面,使用户可以查询数据库。

I guess I should work with SqliteDatabase , but I have no idea how I can make this multi-criteria search interface , so the user can query the database.

推荐答案

这很简单。建立数据库后,您可以使用SQL查询和WHERE critaria终于achive正确的数据,使用Cursor类结果通过迭代JOIN类型。

It's simple. after setup your database, you can use SQL queries and JOIN types with WHERE critaria and finally achive proper data, use Cursor class to iterate through results.

请参阅:
http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html

http://www.w3schools.com/sql/sql_where.asp

http://www.w3schools.com/sql/sql_and_or.asp

http://www.w3schools.com/sql/sql_join_inner.asp

这篇关于SQLite的高级搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆