SQLite 按日期排序1530019888000 [英] SQLite Order By Date1530019888000

查看:40
本文介绍了SQLite 按日期排序1530019888000的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 SQLite 数据库中的每条记录都包含一个字段,该字段包含一个以 'yyyy- 格式存储为 stringDateMM-dd HH:mm:ss'.

Every record in my SQLite database contains a field which contains a Date stored as a string in the format 'yyyy-MM-dd HH:mm:ss'.

是否可以查询数据库以获取包含最近日期的记录?

Is it possible to query the database to get the record which contains the most recent date please?

推荐答案

你可以这样做

SELECT * FROM Table ORDER BY date(dateColumn) DESC Limit 1

这篇关于SQLite 按日期排序1530019888000的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆