lundi 7 septembre 2015

Selecting one row from duplicate rows mysql/sqlite

My table (Data_A) consists of columns:
_id | mac_address | bit

There are multiple rows with same mac_address and bit may be 0/1.
I want to construct a sqlite query where I want to select _id of all the rows such that each row has its unique mac_address and PREFERENCE should be given to selecting a row which has bit =1.

Aucun commentaire:

Enregistrer un commentaire