我经历了许多相关的线程,但我还没有成功。
我不知道我哪里出错了,我有以下方法来获取行。
public Cursor getallrows (String fid , String sid , String bid , String pid , String limit)
{
return db.query(DATABASE_ALLPENLIST, new String[] {"rowpos","Peninnerid","issampled","onesymbol","twosymbol","threesymbol","foursymbol","fivesymbol","buildingid","farmid","sampleid","penid"}, "farmid = "+fid+" and sampleid = "+sid+" and buildingid = "+bid+" and penid = "+pid , null, null, null,"RANDOM()",limit);
}
但是上面的方法返回了限制中提到的正确行数,但不是随机顺序,它返回限制变量中提到的前 n 行。
这是RANDOM()
区分大小写的吗?但我也试过用Random()
and"RANDOM() LIMIT "+limit
代替第 7 个参数。
提前致谢 。