Can I use UNIQUE in the query() parameter?

by Bin Chen » Sun, 12 Apr 2009 20:51:58 GMT


Sponsored Links
 My contacts contain a lot of duplicated records, I want to use the
traditional SQL clause "UNIQUE" to get the unique records, is it
doable thru the query() method call? Thanks. I tried with the
selectionArgs argument but failed.

Bin
--~--~---------~--~----~------------~-------~--~----~



Can I use UNIQUE in the query() parameter?

by Mark Murphy » Sun, 12 Apr 2009 20:55:05 GMT


 


I am not aware of a UNIQUE clause in queries in SQL. There is DISTINCT
to get the unique records, and MySQL has a UNIQUE constraint in CREATE
TABLE and ALTER TABLE.

Regardless, you may want to try rawQuery() instead of query() -- I tend
to use that for things that are outside the ordinary.

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

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

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. npapi plugin for android

hi,

I am trying to write an npapi plugin for android browser.
i found that the android 2.2 sdk supply only the pluginstub interface for
that purpose.
has anyone any idea about the manner that we could implement that interface.
is there any example to clarify that issue.

Please help me, all clues are welcome.

-- 

2. NFC doubts. JSR 257 - 177

Hi,

Ive been working on NFC with my Samsung 5230 mobile, and now I am
considering to move to Android. Before I do that I have some
questions. Ive been reading the group and the developers web page,
but still have some doubts.

- Is it possible to read MIFARE DESFire tags using the standard API.
In order to do that I have always used the JSR 257 spec. but I dont
know if it is possible to do something similar with the current
Android version.

- Suppose that I have a tag that is a sticker always affixed to the
mobile phone. Is it possible to read it always my application is
started?? In the mobile I used to work with it was a limitation since
once the sticker was detected the first time it could not detect it
anymore until I removed the sticker from the mobile NFC range and got
it close again. Would be possible using Android API to detect it
anytime I start the app without having to remove it??

- I am working on JavaCard too and I have developed an applet in order
to complete the authentication steps in a secure way. Is it possible
to access JavaCard applets in my SD card using Android API. Until that
moment I have used the JSR 177 (APDU Connection, ...) in order to do
that. The problem with others mobile is that to access the SD you have
to sign your midlet with a Verysign certificate, but I dont want to
do this.

Thanks a lot.
Best regards.

-- 

3. to startup with developing apps

4. use android media player native components at application layer

5. NFC Android

6. manual building of apk's

7. Manaul creation of APK's