尝试按“ID”命令从内容提供商处收到数据时,我收到此错误:
android.database.sqlite.SQLiteException:模糊列名:_id(代码1):,同时编译:SELECT anydo_tasks.due_date,anydo_tasks.title,anydo_categories.name AS category_name,anydo_tasks._id,anydo_tasks.status,anydo_tasks。 priority FROM anydo_tasks INNER JOIN anydo_categories ON anydo_tasks.category = anydo_categories._id WHERE(status<> 0 AND parent_task_id IS NULL)AND(status =?)ORDER BY _id ASC
我正在运行的代码是:
String orderBy = TasksContract.TasksColumns.ID + " ASC";
mCursor = mContext.getContentResolver().query(TasksContract.TASKS_URI, null,TasksContract.TasksColumns.STATUS + "=?", new String[]{String.valueOf(TasksContract.STATUS_UNCHECKED) }, orderBy, null);
我在这里看到其他问题表明这可能是因为两个表使用ID,但在我的查询中我很确定我正在指定正确的表。这是怎么回事?