Search mysql table starting from last row

后端 未结 3 1462
轮回少年
轮回少年 2021-01-19 09:13

So, I know that there is no such thing as \"last row\" on relational databases but I couldn\'t find a better word to explain what I want to do. I have a table that looks lik

3条回答
  •  鱼传尺愫
    2021-01-19 10:09

    What you're asking for is an index. I suggest you do some research into how b-tree indexes work.

    If you had an index on the time field, the engine would essentially do what you're asking for - as the index would be ordered, it would "know" that it only needs to find the earliest point you're asking for and return everything after it.

    http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html

提交回复
热议问题