3

I am trying to join two tables and get a cursor from it so that i contains results from both the table and i can pass that cursor in CursorAdapter.

I tired to Google the solution, got many but not able to implement it right

I tried this solution but do not able to figure out what it means. how to use join query in CursorLoader when its constructor does not support it

My tables are like this .

Table - Deal (Id, name, sms, title,categoryid,subcategoryid)

Table - SubCategory (Id, name, status,title,categoryid)

I want to join my these two tables such that "Get all deals where subcategoryid.status=true"

Community
  • 1
  • 1
Bora
  • 1,933
  • 3
  • 28
  • 54

2 Answers2

0

what are the keys in both tables? also, is the subcategory in the Deal table the same as Id column in the SubCategory table?

Yoseph Hagos
  • 11
  • 1
  • 3
0

select d.id, d.name, d.sms, d.title, d.categoryid, d.subcategoryid, sc.name, sc.title, sc.categoryid from Deal d, SubCategory sc where d.subcategoryid = sc.Id and sc.status = true;

Yoseph Hagos
  • 11
  • 1
  • 3