0

我对如何AND在 rawQuery 中放置条件有疑问。我想getCount WHERE SQLiteHelper.product_FId =listId AND SQLiteHelper.product_Status==1...我应该在哪里添加另一个条件WHERE SQLiteHelper.product_Status==1

public int getCountComplePro(String listId) {
        // TODO Auto-generated method stub
        String[] args = { listId };
        int x = 0;
        Cursor cur=database.rawQuery("SELECT * FROM "
                + SQLiteHelper.productTable + " WHERE "
                + SQLiteHelper.product_FId +"=?" ,args);

       x=cur.getCount();

}

        cur.close();
        return x;

希望任何人都可以指导我解决这个问题...

4

1 回答 1

1
String[] args = { listId };
Cursor cur=database.rawQuery("SELECT * FROM "
                + SQLiteHelper.productTable + " WHERE "
                + SQLiteHelper.product_FId +"=?"
                + "AND "+SQLiteHelper.product_Status+ "=1",args);

这不应该做吗?

于 2012-12-01T10:20:43.473 回答