我正在创建记事本,现在当我尝试通过动态传递 id 并使用 Order by 来实现连接时遇到问题。它在“=”附近给出SQLiteexception。
我不知道我写这个查询的原因是什么:
String selectQuery = "SELECT " + KEY_TASKNOTE + " FROM " + TABLE_TODOTASK
+ " INNER JOIN" + TABLE_TODOTASK_DETAILS + "ON " + KEY_TASKID + "=" + KEY_TASK_DETAILS_TASKID + " WHERE "
+ KEY_TASK_TASKLISTID + "=" + tasklist_Id + " ORDER BY " + KEY_TASK_DETAILS_DUEDATE;
常数:
// TASK table name
private static final String TABLE_TODOTASK = "todotask";
// TASKLIST Table Columns names
private static final String KEY_TASKID = "Id";
private static final String KEY_TASKNOTE = "tasknote";
private static final String KEY_TASKDUEDATE = "duedate";
private static final String KEY_TASKCOMPLETED = "taskcompleted";
private static final String KEY_TASK_TASKLISTID = "TaskList_id";
// TASKDETAILS table name
private static final String TABLE_TODOTASK_DETAILS = "todotaskdetails";
// TASKDETAILS Table Columns names
private static final String KEY_TASK_DETAILS_ID = "ID";
private static final String KEY_TASK_DETAILS_TASKID = "Task_id";
private static final String KEY_TASK_DETAILS_DUEDATE = "taskduedate";
private static final String KEY_TASK_DETAILS_EVENT = "taskevent";
private static final String KEY_TASKDETAILS_REMINDER = "taskreminder";
private static final String KEY_TASKDETAILS_REPEAT = "taskrepeat";
private static final String KEY_TASKDETAILS_PRIORITY = "taskpriority";
请帮忙,谢谢