有时候,我会看到ORDER BY date, id
。为什么需要id
?
两个不同时期如何平等?
timestamp
的精确度是多少?
答案 0 :(得分:1)
你问过" ORDER BY date,id。"但随后提到时间戳。名为date的字段可能是时间戳类型或日期类似' YYYY / MM / DD'在这种情况下,按ID排序
答案 1 :(得分:1)
Since timestamps are discrete values there can be multiple timestamps with the same value regardless of the precision. The bigger the precision the least likely is a collision. An untie criteria is necessary if that is relevant.