0

我对按日期升序有问题...我想按 listDate( 日期格式 ) 对所有日期进行分组,我认为我的代码有问题..

public Cursor getAll() {
        // TODO Auto-generated method stub
        return (database.rawQuery("SELECT " + SQLiteHelper.listId + " as _id, "
                + SQLiteHelper.listName + "," + SQLiteHelper.listDate + ","
                + SQLiteHelper.listDest + " FROM " + SQLiteHelper.listTable
                + " ORDER BY " + SQLiteHelper.listDate+ "ASC",null));

    }


private static final String CREATE_SHOPPLINGLIST_TABLE = "CREATE TABLE IF NOT EXISTS "
            + listTable
            + " ("
            + listId
            + " INTEGER PRIMARY KEY AUTOINCREMENT, "
            + listName
            + " TEXT, "
            + listDest + " TEXT," + listDate + " INTEGER)";

希望有人能纠正我的错误...

4

1 回答 1

0

试试这个..

return (database.rawQuery("SELECT " + SQLiteHelper.listId + " as _id, "
                + SQLiteHelper.listName + "," + SQLiteHelper.listDate + ","
                + SQLiteHelper.listDest + " FROM " + SQLiteHelper.listTable
                + " ORDER BY " + SQLiteHelper.listDate+ " ASC",null));

给空间" ASC"

于 2012-11-30T05:40:18.763 回答