-1
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);

I was run this same query with other sqlite tool. It works just fine. But, when I try to use with cursor. I got an error

java.lang.IllegalArgumentException: column '_id' does not exist

I got so many solutions. But, nothing worked for me. I will be happy, if you guys help me to solve that.

user2579475
  • 993
  • 3
  • 10
  • 20

1 Answers1

0

The SQL language does not use == but rather =.

so it s/b:

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);

You could also increase performance by using inner joins rather that a where clause:

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);
Roy Hinkley
  • 9,232
  • 19
  • 74
  • 114