Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Cursor cursor = db.rawQuery("SELECT id,lastname FROM people WHERE lastname='John Kenedy'; ",null);
比较的正确用法是String?如果不是,我如何比较String数据库中的值?
String
为了获得更好的性能,您应该使用更快、更安全的rawQuery方法来避免将数据直接添加到语句中。selectionArgs所以试试这样
rawQuery
selectionArgs
Cursor cursor = db.rawQuery("SELECT id,lastname FROM people WHERE lastname = ?; ", new String[] {"John Kenedy"});