嗨,我已经在下面提到了这个查询。
这个查询的目的是保存本地数据库中的两列,我已经发送了它的数量。对于将获得的运费金额。但旧版本的第一个值只能得到它。但新版本成功更新。为什么我不知道它不是更新旧版本。
询问:
mCursor = db.rawQuery("select ROUND(deliverycharge) from pincodedetails where ROUND(subtotal) <=( select ROUND(subtotal) from pincodedetails where ROUND(subtotal)>="+price+" and resturantID="+selArgs+" LIMIT 1) and resturantID="+selArgs+" and ROUND(subtotal) >=( select ROUND(subtotal) from pincodedetails where ROUND(subtotal)<="+price+" and resturantID="+selArgs+" LIMIT 1) order by ROUND(subtotal) LIMIT 1", null);
我认为旧版本不支持 LIMIT 1。
请给我解决方案?
public double getAllPincodeDetails(
String dinein_restaurant_id,Double GetAllPrice ) {
// TODO Auto-generated method stub
String selArgs = dinein_restaurant_id;
Double price = GetAllPrice;
String query = "select ROUND(delivarycharge) from pincodedetails where ROUND(subtotal) <=( select ROUND(subtotal) from pincodedetails where ROUND(subtotal)>="+price+" and resturantID="+selArgs+" LIMIT 1) and resturantID="+selArgs+" and ROUND(subtotal) >=( select ROUND(subtotal) from pincodedetails where ROUND(subtotal)<="+price+" and resturantID="+selArgs+" LIMIT 1) order by ROUND(subtotal) LIMIT 1";
Log.i(this.toString(), "Message"+query);
mCursor = db.rawQuery("select ROUND(delivarycharge) from pincodedetails where ROUND(subtotal) <=( select ROUND(subtotal) from pincodedetails where ROUND(subtotal)>="+price+" and resturantID="+selArgs+" LIMIT 1) and resturantID="+selArgs+" and ROUND(subtotal) >=( select ROUND(subtotal) from pincodedetails where ROUND(subtotal)<="+price+" and resturantID="+selArgs+" LIMIT 1) order by ROUND(subtotal) LIMIT 1", null);
double delivarycharge = 0;
if (mCursor.moveToFirst())
{
// Got first result
delivarycharge = mCursor.getDouble(0);
//System.out.println("***************"+mCursor.getString(mCursor.getColumnIndex("totamount")));System.out.println("***************"+mCursor.getString(mCursor.getColumnIndex("price")));
}
//
return delivarycharge;
}