SQLite Order By Date1530019888000

前端 未结 9 734
臣服心动
臣服心动 2020-12-01 03:27

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

9条回答
  •  眼角桃花
    2020-12-01 03:46

    When you sure the format of text field is yyyy-MM-dd HH:mm:ss (ex.: 2017-01-02 16:02:55), So It works for me simply:

    SELECT * FROM Table ORDER BY dateColumn DESC Limit 1

    Without any extra date function!

提交回复
热议问题