lundi 7 septembre 2015

Search string array elements in sqlitedb

I have table that contains 7 columns that are ID, NAME, LAT, LON, SPEED and TYPE. The table name is route and by using this code i m able to find the required item from database using the ID field that is provide by search bar against the NAME field but now i want to query similar more items in NAME columns and get there IDs, which i would like to store in cursor. The problem is due to less knowledge about SQL i m unable to write the statement for query.

 public Cursor selectByID(long id)
    {
        return db.rawQuery("SELECT * FROM " + TABLE_NAME + " WHERE " + K_ID + " = " + id, null);
    }

Aucun commentaire:

Enregistrer un commentaire