我在 Android 设备上的 SQLite 中有这张表:
CREATE TABLE IF NOT EXISTS MEN(_id INTEGER PRIMARY KEY AUTOINCREMENT,
Tdate date, Weight float, Total float, BMI float);
我以这种日期格式插入数据(31/05/2011 22:34)
String Tdate = android.text.format.DateFormat.format("dd/MM/yyyy k:mm", new java.util.Date());
SQL = "insert into MEN (Tdate,Weight,Total,BMI) values ('";
SQL += Tdate + "','" + ThisWeight + "','" + Total + "','" + BMI+ "')";
我运行这样的查询:
SELECT _id,Tdate,Weight,Total,BMI FROM MEN ORDER BY Tdate desc
但我看到数据没有排序:
31/05/2013 22:20
31/05/2013 19:06
29/04/2013 17:33
02/06/2013 19:25
02/06/2013 19:24