我想用where子句检索数据库中保存的已计数行数,在SQlite中,我是初学者并且很难执行此sql查询
Select Count(*) From " + Table_Seekers + " where " + Uid + " = " + Table_Seekers
我想获得数据库中计数的行数,其中传入的Uid在db中是相同的?所以请任何人帮忙。
public void getReqMade(String Uid) {
SQLiteDatabase database = getReadableDatabase();
database.execSQL("Select Count(*) From " + Table_Seekers + " where " + Uid + " = " + Table_Seekers);
}
答案 0 :(得分:1)
如果Table_Seekers
是表格的名称,而Uid
就是您要搜索的内容,那么
Select Count(*) From Table_Seekers where Table_Seekers_field = Uid
此外,您应该以小写字母命名方法的参数。