SQL Best Practices - Ok to rely on auto increment field to sort rows chronologically?

后端 未结 7 1437
面向向阳花
面向向阳花 2021-01-01 18:52

I\'m working with a client who wants to add timestamps to a bunch of tables so that they may sort the records in those tables chronologically. All of the tables also have a

7条回答
  •  鱼传尺愫
    2021-01-01 19:32

    Auto-incrementing ID will give you an idea of order as Brad points out, but do it right - if you want to know WHEN something was added, have a datetime column. Then you can not only chronologically sort but also apply filters.

提交回复
热议问题