0

我尝试从具有许多条件子句的数据库表中选择数据,其中我的代码看起来像这样

Cursor cursor = sqliteDatabase.rawQuery("SELECT "+  
                AndroidOpenDbHelper.COLUMN_NAME_FILE_NAME+" FROM " + 
                AndroidOpenDbHelper.TABLE_FILE + " where "+ 
                AndroidOpenDbHelper.COLUMN_NAME_FILE_CATEGORY+" = "+ category+","+
                AndroidOpenDbHelper.COLLUMN_NAME_FILE_THEME+" = "+theme+","+ 
                AndroidOpenDbHelper.COLLUMN_NAME_FILE_DATE_CREATING+"="+date);

我知道这是代码不正确,我该如何更正

4

1 回答 1

0

使用一个 WHERE 并将条件与 AND 结合

... 其中 a=5 AND b=7 AND c='Ivan'

于 2012-06-16T10:39:56.093 回答