문제

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