What Mark said, you probably meant DISTINCT. For reference, the Sqlite3 doc on SELECT is here: http://www.sqlite.org/lang_select.html
Also remember that you have the sqlite3 binary either in SDK/tools or via adb shell. It can be handy to simulate your select manually once before you code your query. R/ On Sun, Apr 12, 2009 at 5:54 AM, Mark Murphy <mmur...@commonsware.com> wrote: > > Bin Chen wrote: >> 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. > > 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 > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---