使用IN AND进行Android数据库查询

时间:2014-01-13 12:35:15

标签: android sqlite

我的查询有问题,我没有数据,我的语法是否正确?

StringBuilder sb = new StringBuilder().append(MyTable.FIELDONE)
    .append(" in (?, ?, ?) AND ").append(MyTable.FIELDTWO)
    .append("=? AND ").append(MyTable.FIELDTHREE).append("=?");

String[] args = new String[] { "1", "2", "0", "0", "0" };

Cursor cCategory = getActivity().getContentResolver().query(
    MyTable.CONTENT_URI, MyTable.PROJECTION, sb.toString(), args,
    MyTable.SORT_ORDER);

0 个答案:

没有答案