سؤال

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?

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top