mahantesh Hunagund wrote:
> I wanted to remove duplicates from the database. In my db duplication
> can be defined by combination of multiple columns. 
> For example : 
>  
> _id      kind      type   Pid    name
> 1         1           1        3       aaa
> 2         1           2        3       aaa
> 3         1           1        3       aaa
> 4         2           1        3       aaa
> 5         4            1        4      bbb
>  
> Here : combination of tuple <kind and type> make the uniqueness.  
>  For sample query : get the row for the pid =3 , query should return
> rows: 1,2,4  
>  
> I can to use "distinct" clause in my sql query.  Can anyone tell me how
> to specify distict clause in query  provided by android content
> provider? 

You can't.

You cannot assume that a ContentProvider uses a SQL-compliant database
for its storage. It might use flat files. It might use a db4o. It might
use a cache for data retrieved off of a Web service.

Hence, the syntax for the "selection" and "selectionArgs" is up to the
provider. However, even for SQLite-backed providers, "selection" is
simply the WHERE clause without the keyword WHERE, so you do not have
access to the spot to put the DISTINCT keyword.

> If I opt for writting rawQuery how to specify projection and URI ? 

There is no rawQuery() option for ContentProvider, AFAIK.

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

_The Busy Coder's Guide to *Advanced* Android Development_
Version 1.0 Available!

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

Reply via email to