Question

Is it possible to use advanced SQL queries involving inner join/outer Join in Content Providers? How is this done? My other question: Is it necessary to create a new Database inside Content Providers? Can we use an already existing DB?

Was it helpful?

Solution

Yes you can do an inner join/outer join in a content provider. Like this:

String tables = "table1 LEFT OUTER JOIN table2 ON (table1.sportId = table2._id)";
queryBuilder.setTables(tables);

And don't need to make a new instance you can just pass it through in the constructor if you want. Or make from you database class an Singleton.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top