在Android中使用Select子句进行左外连接

我试图在我的SQLite数据库上运行此查询:

SELECT * FROM tag LEFT OUTER JOIN (SELECT tag, annotation FROM annotation_tag_map WHERE annotation = ?) AS map ON tag._id = map.tag;

的?是注释的ID.

当我在android中运行此查询时,我得到一个空光标.

但是,当我从同一数据库的命令行使用sqlite3运行它时,我得到了我想要的结果.

最佳答案 在运行时检查您的查询并输入获得Rsults的命令行?

如果是,那么,

Cursor cursor = database.rawQuery(Your Query as a String,null);
点赞