我在android中创建了sqlite数据库,如下所示:
db.execSQL("CREATE TABLE ratecard (fat NUMERIC, lac NUMERIC, snf NUMERIC,
cow NUMERIC, buf NUMERIC)");
然后我将记录插入如下
DecimalFormat degreeformat = new DecimalFormat("#.#");
DecimalFormat rateformat = new DecimalFormat("#.##");
Double csn = 0.20;
Double bsn = 0.00;
Double cft = 0.50;
Double bft = 0.00;
Double crt = 20.00 - cft - csn;
Double brt = 0.00 - bft - bsn;
for (Double ss = 7.0; ss <= 8.0); ss = ss + .1) {
ProcSnf.setText(degreeformat.format(ss));
crt = crt + csn;
brt = brt + bsn;
Double crrt = crt;
Double brrt = brt;
for (Double ff = Double.valueOf(fromfat); ff <= Double.valueOf(tofat);
ff = ff + .1) {
ProcFat.setText(degreeformat.format(ff));
Double l = (ss - 0.36 - (ff * .21)) * 4.0;
ll = Double.valueOf(degreeformat.format(l));
crrt = crrt + cft;
brrt = brrt + bft;
DB.DeleteSelectedRateCard(ff, ss);
DB.AddRateCard(ll, ff, ss, crrt, brrt);
}
}
在数据库中创建的记录。然后,我将此数据库从模拟器中拉到硬盘上。然后,我使用sqlite浏览器浏览此数据。所有记录均正确显示。现在,在浏览器中过滤fat = 5.0的记录。显示所有记录。 现在要转到Sqlite浏览器中的“执行SQL”选项卡,我尝试遵循sql语句并获得以下结果。