我想在应用程序中运行此查询:
SELECT Naslov, Kraj FROM Bankomati_db WHERE Banka=selectedBank AND ((ZemljepisnaSirina BETWEEN selectedLatDPod AND selectedLatDNad) AND (ZemljepisnaDolzina BETWEEN selectedLngDPod AND selectedLngDNad))
当我在数据库浏览器中运行它时会返回一些行,而在android中却没有。
我在应用程序中使用此代码:
public Cursor getBankomatCoordinates(){
SQLiteDatabase db = getReadableDatabase();
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
String [] sqlSelect = {"0 _id", "Naslov", "Kraj"};
String sqlTables="Bankomati_db";
String sqlWhere="Banka=? AND ((ZemljepisnaSirina BETWEEN ? AND ?) AND (ZemljepisnaDolzina BETWEEN ? AND ?))";
String [] args = {selectedBank, selectedLatDPod, selectedLatDNad, selectedLngDPod, selectedLngDNad};
qb.setTables(sqlTables);
Cursor c = qb.query(db, sqlSelect, sqlWhere, args, null, null, null);
c.moveToFirst();
return c;
}