samedi 19 septembre 2015

how to use distinct in sqlite and cursor without _id essential column?

I have an table that i should use this query for right answer:

select distinct IDPAGE,TIT from contents where NUM=1;

and send this cursor to cursorAdapter. As you know, in this cursor should be an _id column. if not, app not started. but i just want distinct my tables and not _id col. i want a query like:

select rowid _id distinct IDPAGE,TIT from contents where NUM=1;

in sql , i can use DENSE_RANK() but not in sqlite. please help me...

Aucun commentaire:

Enregistrer un commentaire