我是SQLite的新手。我使用此查询是为了从特定用户的列中提取所有行:
Cursor c = db.query(true, TABLE, COLUMN, USER + "= '" + user + "'", null, null, null, null, null);这是一个表格的例子:
|group-----ID|
|------------|
|one-------me|
|one------you|
|two-------me|
|one-------me|因此,对用户"me“的查询提取”一,二,一“。如何对结果进行过滤,只获得一次值?就像“一,二”
谢谢
发布于 2012-12-11 06:18:02
将Group By参数与相应的列名一起使用:
Cursor c = db.query(true, TABLE, COLUMN, USER + "= '" + user + "'", null,
"group", null, null, null);由于此方法中有9个参数和3个几乎相同的方法...
public Cursor query(boolean distinct,
String table,
String[] columns,
String selection,
String[] selectionArgs,
String groupBy, /* this one */
String having,
String orderBy,
String limit)https://stackoverflow.com/questions/13810208
复制相似问题