如果你时间的字段为time的话
就这样select * from x_table order by time

解决方案 »

  1.   

    我觉得String 的格式支持查询完毕后的排序。你可以做一下试验,我认为可以。只要不是汉字都可以。
      

  2.   

    mysql> select * from topic order by lastpost desc;
    +---------+---------+-------+---------------------+--------+----------+--------+
    ----------+------+----------+-------+----------+-------+------------+-----------
    -+
    | topicid | forumid | title | lastpost            | pollid | username | userid |
     dateline | hits | iconname | notes | islocked | istop | lastpostor | replycount
     |
    +---------+---------+-------+---------------------+--------+----------+--------+
    ----------+------+----------+-------+----------+-------+------------+-----------
    -+
    |       3 |     122 | 12    | 2003-01-24 08:10:01 |      0 |          |      0 |
              |    0 |          |       |        0 |     0 |            |          0
     |
    |       2 |     122 | 12    | 2003-01-24 00:00:00 |      0 |          |      0 |
              |    0 |          |       |        0 |     0 |            |          0
     |
    |       1 |     122 | 12    | 2003-01-23 00:00:00 |      0 |          |      0 |
              |    0 |          |       |        0 |     0 |            |          0
     |
    +---------+---------+-------+---------------------+--------+----------+--------+
    ----------+------+----------+-------+----------+-------+------------+-----------