Android SQLite查询报错no such column?
报错信息:
08-17 23:48:10.223: E/SQLiteLog(11984): (1) no such column: MessageHistory.MessageTime
08-17 23:48:10.233: E/ContactsDatabase(11984): getMessages debug, error : no such column: MessageHistory.MessageTime (code 1): , while compiling: select * from (select * from MessageHistory inner join _User on MessageHistory.[ReceUserId] = _User.[objectId] order by MessageHistory.[MessageTime] ) group by ReceUserId;
可以确定的是代码中所有涉及到的列在数据库里都是存在的。
查询代码:
SQLiteDatabase db = getReadableDatabase();
Cursor c = db.rawQuery("select * from (select * from MessageHistory inner join _User on MessageHistory.[ReceUserId] = _User.[objectId] order by MessageHistory.[MessageTime] ) group by ReceUserId;", null);
c.moveToFirst();
while (c.moveToNext()) {
}
所以问题到底出在哪里?求大神帮忙解答!
exception Android android-dev sqlite sql-sqlite-android
相对1的⑥酱
9 years, 4 months ago