我尝试在安卓设备上创建一个临时表(sqlite)。
以下是代码片段:
// No error - But cannot create TEMP table
database.rawQuery("CREATE TEMP TABLE IF NOT EXISTS tt1 (unread_message int, target varchar)", null);
// Error - android.database.sqlite.SQLiteException: no such table: tt1: , while compiling: INSERT INTO tt1 SELECT count(*), target FROM messages where read_status=0 and direction=1 GROUP BY target
database.rawQuery("INSERT INTO tt1 SELECT count(*), target FROM messages where read_status=0 and direction=1 GROUP BY target", null);
创建TEMP TABLE的查询没有错误,但第二个查询却抱怨tt1不存在。我是不是以错误的方式创建了TEMP表?