lundi 4 janvier 2016

Android sqlite fetch anyone row in different groups

I am having a table "example". In that table I am having 3 columns say name,id,dept. Here except dept other two is unique i.e,. records should not be repeated.

name | id |dept

a |1 |electronics

b | 2 |electronics

c | 3 |information technology

d | 4 |information technology

e | 5 |mechanical

f | 6 |mechanical

here i want to return

name | id |dept

a |1 |electronics

c | 3 |information technology

e | 5 |mechanical

i tried with using distinct keyword but it returns nothing.

Thank you in advance

Aucun commentaire:

Enregistrer un commentaire