mardi 12 janvier 2016

Select query for loading items on spinner selection

i have a spinner filled with value (category from category table) from sqlite now i need a select query to retrieve items into listView. such that on spinner selection change listview values also change listview . items are coming from another table (items).cid is foreign key in items table and cid is primary key in category table i tried this but showing empty listview....

 String select = "SELECT " +
            Support.KEY_INAME + " FROM "
            + Support.TABLE_ITEMS + " LEFT JOIN "
            + Support.TABLE_CAT + " ON "
            + (Support.TABLE_ITEMS + "." + Support.KEY_CID) +" = "
            + (Support.TABLE_CAT + "." + Support.KEY_CID)
            + " WHERE " + Support.TABLE_CAT + "." + Support.KEY_CID + " =?";

Aucun commentaire:

Enregistrer un commentaire