Android : java.lang.IllegalArgumentException: column '_id' does not exist -
cursor ck = db.rawquery("select name,title,text,type abstracts_item,abstract_author,authors_abstract abstract_author._id == authors_abstract.abstractauthor_id , abstracts_item._id == authors_abstract.abstractsitem_id", null);
i run same query other sqlite tool. works fine. but, when try use cursor
. got error
java.lang.illegalargumentexception: column '_id' not exist
i got many solutions. but, nothing worked me. happy, if guys me solve that.
the sql language not use ==
rather =
.
so s/b:
cursor ck = db.rawquery("select name,title,text,type abstracts_item,abstract_author,authors_abstract abstract_author._id = authors_abstract.abstractauthor_id , abstracts_item._id = authors_abstract.abstractsitem_id", null);
you increase performance using inner joins rather clause:
cursor ck = db.rawquery("select name,title,text,type 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);
Comments
Post a Comment