Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/200.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android:java.lang.IllegalArgumentException:column'_id';不存在_Java_Android - Fatal编程技术网

Android:java.lang.IllegalArgumentException:column'_id';不存在

Android:java.lang.IllegalArgumentException:column'_id';不存在,java,android,Java,Android,我使用其他sqlite工具运行了相同的查询。它很好用。但是,当我尝试使用游标时。我犯了个错误 Cursor ck = db.rawQuery("select name,title,text,type from abstracts_item,abstract_author,authors_abstract where abstract_author._id == authors_abstract.abstractauthor_id and abstracts_item._id == author

我使用其他sqlite工具运行了相同的查询。它很好用。但是,当我尝试使用
游标时
。我犯了个错误

Cursor ck = db.rawQuery("select name,title,text,type from abstracts_item,abstract_author,authors_abstract where abstract_author._id == authors_abstract.abstractauthor_id and abstracts_item._id ==  authors_abstract.abstractsitem_id", null);

我有很多解决办法。但是,对我来说什么都不管用。如果你们能帮我解决这个问题,我会很高兴的。

SQL语言不使用
=
,而是使用
=

因此,s/b:

java.lang.IllegalArgumentException: column '_id' does not exist
您还可以通过使用内部联接来提高性能,而不是使用where子句:

Cursor ck = db.rawQuery("select name,title,text,type from
abstracts_item,abstract_author,authors_abstract where abstract_author._id =
authors_abstract.abstractauthor_id and abstracts_item._id =
authors_abstract.abstractsitem_id", null);

“from abstracts\u item,abstract\u author,authors\u abstract”,from子句有3个表,这是有效语法吗?@Nambari Nope!我很难理解在没有所需连接的“其他sqlite工具”中这是如何工作的。这是有效的语法。“这是一个隐含连接。”贝尼托。谢谢你。我不知道,我想这是一个内部连接?我想我更喜欢显式连接,因为意图很清楚。你是对的。它是有效的,但已弃用。如果您想了解更多详细信息,请查看此。
Cursor ck = db.rawQuery("select name,title,text,type from abstracts_item 
    inner join abstract_author on abstract_author._id = authors_abstract.abstractauthor_id
    inner join authors_abstract on abstracts_item._id = authors_abstract.abstractsitem_id", null);