public void doQuery(long id, final String name) {
mDb.query("some_table", // table name
null, // columns
"id=" + id + " AND name=?", // selection
new String[] {name}, //selectionArgs
//...... 更多参数省略
);
// ...... 更多代码
}
public void doQuery(long id, final String name) {
mDb.query("some_table", // table name
null, // columns
"id=" + id + " AND name=?", // selection
new String[] {name}, //selectionArgs
//...... 更多参数省略
);
// ...... 更多代码
} database---query中selection用法和selectionArgs用法
本文介绍了一种使用SQL进行数据库查询的方法,特别关注了如何通过构造特定的条件语句来精确地定位到所需的数据记录。

被折叠的 条评论
为什么被折叠?



