Shawn_Chiu wrote:
> How to retrieve data from two tables via the ContentProvider way?
> I.E. the database of Calendar application, include many tables
> including Events and Deleted, and some others.
> I want to retrive records in Events table, whose _sync_id field is
> also in Deleted table.
> Usually, we write a SQL sentence like:
>     select (all fields in Events)
>     from Events as e, Deleted as d
>     where e._sync_id = d._sync_id
> or select *
>     from Events as e
>     where e._sync_id in select _sync_id from Deleted
> etc.
> But, how can I accomplish it in the ContentProvider way? 

Use CursorJoiner (if it fits your use case) or CursorWrapper (if
CursorJoiner is not quite flexible enough).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books.html

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to